返回提交历史
Modified
src/controllers/custom/addItemController.ts
+4
-2
Modified
src/services/inventoryService.ts
+2
-1
XFEstudio/SpaceNinjaServer
chore: fix no-case-declarations warnings
b0c3e725
代码差异
2 个文件
+6
-3
@@ -9,15 +9,17 @@ const addItemController: RequestHandler = async (req, res) => {
9
9
const request = toAddItemRequest(req.body);
10
10
11
11
switch (request.type) {
12
case ItemType.Powersuit:
12
case ItemType.Powersuit: {
13
13
const powersuit = await addPowerSuit(request.InternalName, accountId);
14
14
res.json(powersuit);
15
15
return;
16
case ItemType.Weapon:
16
}
17
case ItemType.Weapon: {
17
18
const weaponType = getWeaponType(request.InternalName);
18
19
const weapon = await addEquipment(weaponType, request.InternalName, accountId);
19
20
res.json(weapon);
20
21
break;
22
}
21
23
default:
22
24
res.status(400).json({ error: "something went wrong" });
23
25
break;
@@ -262,7 +262,7 @@ export const addItem = async (
262
262
}
263
263
}
264
264
break;
265
case "Weapons":
265
case "Weapons": {
266
266
const weaponType = getWeaponType(typeName);
267
267
const weapon = await addEquipment(weaponType, typeName, accountId);
268
268
await updateSlots(accountId, InventorySlot.WEAPONS, 0, 1);
@@ -272,6 +272,7 @@ export const addItem = async (
272
272
[weaponType]: [weapon]
273
273
}
274
274
};
275
}
275
276
case "Objects": {
276
277
// /Lotus/Objects/Tenno/Props/TnoLisetTextProjector (Note Beacon)
277
278
const inventory = await getInventory(accountId);