diff --git a/src/controllers/custom/unlockAllScansController.ts b/src/controllers/custom/unlockAllScansController.ts index ca7990cb..684c75ab 100644 --- a/src/controllers/custom/unlockAllScansController.ts +++ b/src/controllers/custom/unlockAllScansController.ts @@ -7,8 +7,7 @@ import { getInventory } from "../../services/inventoryService.ts"; export const unlockAllScansController: RequestHandler = async (req, res) => { const accountId = await getAccountIdForRequest(req); - const stats = await getStats(accountId); - const inventory = await getInventory(accountId, "ChallengeProgress"); + const [stats, inventory] = await Promise.all([getStats(accountId), getInventory(accountId, "ChallengeProgress")]); const scanTypes = new Set(allScans); for (const type of Object.keys(ExportEnemies.avatars)) { @@ -31,7 +30,6 @@ export const unlockAllScansController: RequestHandler = async (req, res) => { }); } - await stats.save(); - await inventory.save(); + await Promise.all([stats.save(), inventory.save()]); res.end(); };