This commit is contained in:
syuilo
2017-01-17 11:11:22 +09:00
parent caa8aee7a0
commit 9f81288fcc
48 changed files with 91 additions and 140 deletions

View File

@@ -34,13 +34,12 @@ module.exports = (params, user) =>
const history = await History
.find({
user_id: user._id
}, {}, {
}, {
limit: limit,
sort: {
updated_at: -1
}
})
.toArray();
});
// Serialize
res(await Promise.all(history.map(async h =>

View File

@@ -90,11 +90,10 @@ module.exports = (params, user) =>
// Issue query
const messages = await Message
.find(query, {}, {
.find(query, {
limit: limit,
sort: sort
})
.toArray();
});
// Serialize
res(await Promise.all(messages.map(async message =>

View File

@@ -125,7 +125,7 @@ module.exports = (params, user) =>
}
// 履歴作成(自分)
History.updateOne({
History.update({
user_id: user._id,
partner: recipient._id
}, {
@@ -138,7 +138,7 @@ module.exports = (params, user) =>
});
// 履歴作成(相手)
History.updateOne({
History.update({
user_id: recipient._id,
partner: user._id
}, {