Fix bug
This commit is contained in:
parent
caa8aee7a0
commit
9f81288fcc
48 changed files with 91 additions and 140 deletions
|
|
@ -46,7 +46,7 @@ module.exports = (params, user) =>
|
|||
}
|
||||
|
||||
// Delete like
|
||||
await Like.updateOne({
|
||||
await Like.update({
|
||||
_id: exist._id
|
||||
}, {
|
||||
$set: {
|
||||
|
|
@ -58,21 +58,21 @@ module.exports = (params, user) =>
|
|||
res();
|
||||
|
||||
// Decrement likes count
|
||||
Post.updateOne({ _id: post._id }, {
|
||||
Post.update({ _id: post._id }, {
|
||||
$inc: {
|
||||
likes_count: -1
|
||||
}
|
||||
});
|
||||
|
||||
// Decrement user likes count
|
||||
User.updateOne({ _id: user._id }, {
|
||||
User.update({ _id: user._id }, {
|
||||
$inc: {
|
||||
likes_count: -1
|
||||
}
|
||||
});
|
||||
|
||||
// Decrement user liked count
|
||||
User.updateOne({ _id: post.user_id }, {
|
||||
User.update({ _id: post.user_id }, {
|
||||
$inc: {
|
||||
liked_count: -1
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue