delete stats when account is deleted
All checks were successful
Build / build (20) (pull_request) Successful in 33s
Build / build (22) (pull_request) Successful in 50s
Build / build (18) (pull_request) Successful in 1m26s

This commit is contained in:
AMelonInsideLemon 2025-02-04 21:11:59 +01:00
parent 8492720fd0
commit b46f2a1f59
2 changed files with 4 additions and 2 deletions

View File

@ -5,6 +5,7 @@ import { Inventory } from "@/src/models/inventoryModels/inventoryModel";
import { Loadout } from "@/src/models/inventoryModels/loadoutModel";
import { PersonalRooms } from "@/src/models/personalRoomsModel";
import { Ship } from "@/src/models/shipModel";
import { Stats } from "@/src/models/statsModel";
export const deleteAccountController: RequestHandler = async (req, res) => {
const accountId = await getAccountIdForRequest(req);
@ -13,7 +14,8 @@ export const deleteAccountController: RequestHandler = async (req, res) => {
Inventory.deleteOne({ accountOwnerId: accountId }),
Loadout.deleteOne({ loadoutOwnerId: accountId }),
PersonalRooms.deleteOne({ personalRoomsOwnerId: accountId }),
Ship.deleteOne({ ShipOwnerId: accountId })
Ship.deleteOne({ ShipOwnerId: accountId }),
Stats.deleteOne({ accountOwnerId: accountId })
]);
res.end();
};

View File

@ -27,8 +27,8 @@ const viewController: RequestHandler = async (req, res) => {
for (const type of Object.keys(ExportEnemies.avatars)) {
if (!scans.has(type)) scans.add(type);
}
for (const type of scans) {
responseJson.Scans ??= [];
for (const type of scans) {
responseJson.Scans.push({ type: type, scans: 9999 });
}
}