Fix bug
This commit is contained in:
parent
caa8aee7a0
commit
9f81288fcc
48 changed files with 91 additions and 140 deletions
|
|
@ -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 =>
|
||||
|
|
|
|||
|
|
@ -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 =>
|
||||
|
|
|
|||
|
|
@ -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
|
||||
}, {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue