返回提交历史
Modified
src/controllers/custom/deleteAccountController.ts
+2
-2
XFEstudio/XFESpaceNinjaServer
fix: use deleteMany for models where accountId is not unique when deleting account (#1290)
Reviewed-on: https://onlyg.it/OpenWF/SpaceNinjaServer/pulls/1290
5817b48d
代码差异
1 个文件
+2
-2
@@ -14,12 +14,12 @@ export const deleteAccountController: RequestHandler = async (req, res) => {
14
14
// TODO: Handle the account being the creator of a guild
15
15
await Promise.all([
16
16
Account.deleteOne({ _id: accountId }),
17
GuildMember.deleteOne({ accountId: accountId }),
17
GuildMember.deleteMany({ accountId: accountId }),
18
18
Inbox.deleteMany({ ownerId: accountId }),
19
19
Inventory.deleteOne({ accountOwnerId: accountId }),
20
20
Loadout.deleteOne({ loadoutOwnerId: accountId }),
21
21
PersonalRooms.deleteOne({ personalRoomsOwnerId: accountId }),
22
Ship.deleteOne({ ShipOwnerId: accountId }),
22
Ship.deleteMany({ ShipOwnerId: accountId }),
23
23
Stats.deleteOne({ accountOwnerId: accountId })
24
24
]);
25
25
res.end();