Removes lens and tells client it worked.

This commit is contained in:
VampireKitten 2024-10-15 16:00:11 +02:00
parent d328e343f5
commit cc5c5d8868

View File

@ -20,10 +20,19 @@ export const focusController: RequestHandler = async (req, res) => {
for (const item of inventory[request.Category]) { for (const item of inventory[request.Category]) {
if (item._id.toString() == request.WeaponId) { if (item._id.toString() == request.WeaponId) {
item.FocusLens = request.LensType; item.FocusLens = request.LensType;
addMiscItems(inventory, [
{
ItemType: request.LensType,
ItemCount: -1
} satisfies IMiscItem
]);
} }
} }
await inventory.save(); await inventory.save();
res.end(); res.json({
weaponId: request.WeaponId,
lensType: request.LensType,
});
break; break;
} }
case FocusOperation.UnlockWay: { case FocusOperation.UnlockWay: {