provide proper response to update CurrentHP after retrieving drone

This commit is contained in:
Sainan 2025-03-02 17:23:50 +01:00
parent 1b7ddcc777
commit 753f8dff39

View File

@ -3,6 +3,7 @@ import { addMiscItems, getInventory } from "@/src/services/inventoryService";
import { getAccountIdForRequest } from "@/src/services/loginService";
import { getRandomElement, getRandomInt } from "@/src/services/rngService";
import { IMongoDate, IOid } from "@/src/types/commonTypes";
import { IDroneClient } from "@/src/types/inventoryTypes/inventoryTypes";
import { IInventoryChanges } from "@/src/types/purchaseTypes";
import { RequestHandler } from "express";
import { ExportDrones, ExportResources, ExportSystems } from "warframe-public-export-plus";
@ -104,11 +105,12 @@ export const dronesController: RequestHandler = async (req, res) => {
drone.PendingDamage = undefined;
drone.ResourceType = undefined;
drone.ResourceCount = undefined;
inventoryChanges.Drones = [drone.toJSON<IDroneClient>()];
}
await inventory.save();
res.json({
// TODO: Let the client know the new HP of this drone... somehow
InventoryChanges: inventoryChanges
});
} else {