delete stats when account is deleted
This commit is contained in:
parent
8492720fd0
commit
b46f2a1f59
@ -5,6 +5,7 @@ import { Inventory } from "@/src/models/inventoryModels/inventoryModel";
|
|||||||
import { Loadout } from "@/src/models/inventoryModels/loadoutModel";
|
import { Loadout } from "@/src/models/inventoryModels/loadoutModel";
|
||||||
import { PersonalRooms } from "@/src/models/personalRoomsModel";
|
import { PersonalRooms } from "@/src/models/personalRoomsModel";
|
||||||
import { Ship } from "@/src/models/shipModel";
|
import { Ship } from "@/src/models/shipModel";
|
||||||
|
import { Stats } from "@/src/models/statsModel";
|
||||||
|
|
||||||
export const deleteAccountController: RequestHandler = async (req, res) => {
|
export const deleteAccountController: RequestHandler = async (req, res) => {
|
||||||
const accountId = await getAccountIdForRequest(req);
|
const accountId = await getAccountIdForRequest(req);
|
||||||
@ -13,7 +14,8 @@ export const deleteAccountController: RequestHandler = async (req, res) => {
|
|||||||
Inventory.deleteOne({ accountOwnerId: accountId }),
|
Inventory.deleteOne({ accountOwnerId: accountId }),
|
||||||
Loadout.deleteOne({ loadoutOwnerId: accountId }),
|
Loadout.deleteOne({ loadoutOwnerId: accountId }),
|
||||||
PersonalRooms.deleteOne({ personalRoomsOwnerId: accountId }),
|
PersonalRooms.deleteOne({ personalRoomsOwnerId: accountId }),
|
||||||
Ship.deleteOne({ ShipOwnerId: accountId })
|
Ship.deleteOne({ ShipOwnerId: accountId }),
|
||||||
|
Stats.deleteOne({ accountOwnerId: accountId })
|
||||||
]);
|
]);
|
||||||
res.end();
|
res.end();
|
||||||
};
|
};
|
||||||
|
@ -27,8 +27,8 @@ const viewController: RequestHandler = async (req, res) => {
|
|||||||
for (const type of Object.keys(ExportEnemies.avatars)) {
|
for (const type of Object.keys(ExportEnemies.avatars)) {
|
||||||
if (!scans.has(type)) scans.add(type);
|
if (!scans.has(type)) scans.add(type);
|
||||||
}
|
}
|
||||||
|
responseJson.Scans ??= [];
|
||||||
for (const type of scans) {
|
for (const type of scans) {
|
||||||
responseJson.Scans ??= [];
|
|
||||||
responseJson.Scans.push({ type: type, scans: 9999 });
|
responseJson.Scans.push({ type: type, scans: 9999 });
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user