Fix bug
This commit is contained in:
parent
caa8aee7a0
commit
9f81288fcc
48 changed files with 91 additions and 140 deletions
|
|
@ -64,14 +64,14 @@ module.exports = (params, user) =>
|
|||
res();
|
||||
|
||||
// Increment following count
|
||||
User.updateOne({ _id: follower._id }, {
|
||||
User.update(follower._id, {
|
||||
$inc: {
|
||||
following_count: 1
|
||||
}
|
||||
});
|
||||
|
||||
// Increment followers count
|
||||
User.updateOne({ _id: followee._id }, {
|
||||
User.update({ _id: followee._id }, {
|
||||
$inc: {
|
||||
followers_count: 1
|
||||
}
|
||||
|
|
|
|||
|
|
@ -53,7 +53,7 @@ module.exports = (params, user) =>
|
|||
}
|
||||
|
||||
// Delete following
|
||||
await Following.updateOne({
|
||||
await Following.update({
|
||||
_id: exist._id
|
||||
}, {
|
||||
$set: {
|
||||
|
|
@ -65,14 +65,14 @@ module.exports = (params, user) =>
|
|||
res();
|
||||
|
||||
// Decrement following count
|
||||
User.updateOne({ _id: follower._id }, {
|
||||
User.update({ _id: follower._id }, {
|
||||
$inc: {
|
||||
following_count: -1
|
||||
}
|
||||
});
|
||||
|
||||
// Decrement followers count
|
||||
User.updateOne({ _id: followee._id }, {
|
||||
User.update({ _id: followee._id }, {
|
||||
$inc: {
|
||||
followers_count: -1
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue