From c98d872d5223ce8a436756174d9c969417b210df Mon Sep 17 00:00:00 2001 From: Sainan Date: Tue, 18 Mar 2025 04:24:22 -0700 Subject: [PATCH] chore: use projection for drones request when possible (#1231) Reviewed-on: https://onlyg.it/OpenWF/SpaceNinjaServer/pulls/1231 --- 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 972f8f6bc..97e0d478c 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!) {