feat(webui): adding modular K-Drives, Amps and Zaw #1374

Merged
Sainan merged 4 commits from AMelonInsideLemon/SpaceNinjaServer:webui-modular into main 2025-03-30 05:10:25 -07:00
Showing only changes of commit 62dd3c04b3 - Show all commits

View File

@ -6,10 +6,11 @@ import { modularWeaponTypes } from "@/src/helpers/modularWeaponHelper";
export const addModularEquipmentController: RequestHandler = async (req, res) => {
const accountId = await getAccountIdForRequest(req);
const request = req.body as IAddModularEquipmentRequest;
const inventory = await getInventory(accountId);
const category = modularWeaponTypes[request.ItemType];
const inventoryBin = productCategoryToInventoryBin(category)!;
const inventory = await getInventory(accountId, `${category} ${inventoryBin}`);
addEquipment(inventory, category, request.ItemType, request.ModularParts);
occupySlot(inventory, productCategoryToInventoryBin(category)!, true);
occupySlot(inventory, inventoryBin, true);
await inventory.save();
res.end();
};