From 902db44737320835bc001dd33a97ad3b1a56b91c Mon Sep 17 00:00:00 2001 From: Sainan Date: Tue, 18 Mar 2025 10:39:39 +0100 Subject: [PATCH] chore: use projection for drones request when possible --- src/controllers/api/dronesController.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/controllers/api/dronesController.ts b/src/controllers/api/dronesController.ts index 972f8f6b..97e0d478 100644 --- a/src/controllers/api/dronesController.ts +++ b/src/controllers/api/dronesController.ts @@ -12,8 +12,8 @@ import { ExportDrones, ExportResources, ExportSystems } from "warframe-public-ex export const dronesController: RequestHandler = async (req, res) => { const accountId = await getAccountIdForRequest(req); - const inventory = await getInventory(accountId); if ("GetActive" in req.query) { + const inventory = await getInventory(accountId, "Drones"); const activeDrones: IActiveDrone[] = []; for (const drone of inventory.Drones) { if (drone.DeployTime) { @@ -39,6 +39,7 @@ export const dronesController: RequestHandler = async (req, res) => { ActiveDrones: activeDrones }); } else if ("droneId" in req.query && "systemIndex" in req.query) { + const inventory = await getInventory(accountId, "Drones"); const drone = inventory.Drones.id(req.query.droneId as string)!; const droneMeta = ExportDrones[drone.ItemType]; drone.DeployTime = config.instantResourceExtractorDrones ? new Date(0) : new Date(); @@ -76,6 +77,7 @@ export const dronesController: RequestHandler = async (req, res) => { await inventory.save(); res.json({}); } else if ("collectDroneId" in req.query) { + const inventory = await getInventory(accountId); const drone = inventory.Drones.id(req.query.collectDroneId as string)!; if (new Date() >= drone.DamageTime!) {