mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-17 14:47:53 +01:00
[WIP] Add initial fixes for concurrency (#9321)
* Add initial fixes for concurrency * Added memory edit for notifications * Fixed tag delete * Fixed adding and moving task order * Updated delete task * Fixed lint * Fixed task adding * Switch to mongoose push and pull
This commit is contained in:
@@ -37,7 +37,10 @@ api.readNotification = {
|
||||
}
|
||||
|
||||
user.notifications.splice(index, 1);
|
||||
await user.save();
|
||||
|
||||
await user.update({
|
||||
$pull: { notifications: req.params.notificationId },
|
||||
}).exec();
|
||||
|
||||
res.respond(200, user.notifications);
|
||||
},
|
||||
@@ -77,7 +80,9 @@ api.readNotifications = {
|
||||
user.notifications.splice(index, 1);
|
||||
}
|
||||
|
||||
await user.save();
|
||||
await user.update({
|
||||
$pullAll: { notifications },
|
||||
}).exec();
|
||||
|
||||
res.respond(200, user.notifications);
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user