返回提交历史
Modified
src/controllers/custom/deleteAccountController.ts
+2
-0
XFEstudio/XFESpaceNinjaServer
fix: delete inbox messages when deleting account (#899)
Reviewed-on: http://209.141.38.3/OpenWF/SpaceNinjaServer/pulls/899 Co-authored-by: Sainan <sainan@calamity.inc> Co-committed-by: Sainan <sainan@calamity.inc>
4353c678
代码差异
1 个文件
+2
-0
@@ -1,6 +1,7 @@
1
1
import { RequestHandler } from "express";
2
2
import { getAccountIdForRequest } from "@/src/services/loginService";
3
3
import { Account } from "@/src/models/loginModel";
4
import { Inbox } from "@/src/models/inboxModel";
4
5
import { Inventory } from "@/src/models/inventoryModels/inventoryModel";
5
6
import { Loadout } from "@/src/models/inventoryModels/loadoutModel";
6
7
import { PersonalRooms } from "@/src/models/personalRoomsModel";
@@ -10,6 +11,7 @@ export const deleteAccountController: RequestHandler = async (req, res) => {
10
11
const accountId = await getAccountIdForRequest(req);
11
12
await Promise.all([
12
13
Account.deleteOne({ _id: accountId }),
14
Inbox.deleteMany({ ownerId: accountId }),
13
15
Inventory.deleteOne({ accountOwnerId: accountId }),
14
16
Loadout.deleteOne({ loadoutOwnerId: accountId }),
15
17
PersonalRooms.deleteOne({ personalRoomsOwnerId: accountId }),