mirror of
https://github.com/misskey-dev/misskey.git
synced 2026-05-04 15:26:08 +02:00
Fix bug
This commit is contained in:
@@ -66,21 +66,21 @@ module.exports = (params, user) =>
|
||||
res();
|
||||
|
||||
// Increment likes count
|
||||
Post.updateOne({ _id: post._id }, {
|
||||
Post.update({ _id: post._id }, {
|
||||
$inc: {
|
||||
likes_count: 1
|
||||
}
|
||||
});
|
||||
|
||||
// Increment user likes count
|
||||
User.updateOne({ _id: user._id }, {
|
||||
User.update({ _id: user._id }, {
|
||||
$inc: {
|
||||
likes_count: 1
|
||||
}
|
||||
});
|
||||
|
||||
// Increment user liked count
|
||||
User.updateOne({ _id: post.user_id }, {
|
||||
User.update({ _id: post.user_id }, {
|
||||
$inc: {
|
||||
liked_count: 1
|
||||
}
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user