Fix bug
This commit is contained in:
@@ -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
|
||||
}, {
|
||||
|
Reference in New Issue
Block a user