返回提交历史
Modified
src/controllers/api/focusController.ts
+1
-1
Modified
src/controllers/api/gildWeaponController.ts
+3
-3
Modified
src/controllers/api/infestedFoundryController.ts
+1
-1
XFEstudio/SpaceNinjaServer
chore: fix non-string concat warnings
9455703b
代码差异
3 个文件
+5
-5
@@ -9,7 +9,7 @@ export const focusController: RequestHandler = async (req, res) => {
9
9
const accountId = await getAccountIdForRequest(req);
10
10
switch (req.query.op) {
11
11
default:
12
logger.error("Unhandled focus op type: " + req.query.op);
12
logger.error("Unhandled focus op type: " + String(req.query.op));
13
13
logger.debug(String(req.body));
14
14
res.end();
15
15
break;
@@ -29,17 +29,17 @@ export const gildWeaponController: RequestHandler = async (req, res) => {
29
29
const data = getJSONfromString(String(req.body)) as IGildWeaponRequest;
30
30
data.ItemId = String(req.query.ItemId);
31
31
if (!modularWeaponCategory.includes(req.query.Category as WeaponTypeInternal | "Hoverboards")) {
32
throw new Error(`Unknown modular weapon Category: ${req.query.Category}`);
32
throw new Error(`Unknown modular weapon Category: ${String(req.query.Category)}`);
33
33
}
34
34
data.Category = req.query.Category as WeaponTypeInternal | "Hoverboards";
35
35
36
36
const inventory = await getInventory(accountId);
37
37
if (!inventory[data.Category]) {
38
throw new Error(`Category ${req.query.Category} not found in inventory`);
38
throw new Error(`Category ${String(req.query.Category)} not found in inventory`);
39
39
}
40
40
const weaponIndex = inventory[data.Category].findIndex(x => String(x._id) === data.ItemId);
41
41
if (weaponIndex === -1) {
42
throw new Error(`Weapon with ${data.ItemId} not found in category ${req.query.Category}`);
42
throw new Error(`Weapon with ${data.ItemId} not found in category ${String(req.query.Category)}`);
43
43
}
44
44
45
45
const weapon = inventory[data.Category][weaponIndex];
@@ -111,7 +111,7 @@ export const infestedFoundryController: RequestHandler = async (req, res) => {
111
111
break;
112
112
113
113
default:
114
throw new Error(`unhandled infestedFoundry mode: ${req.query.mode}`);
114
throw new Error(`unhandled infestedFoundry mode: ${String(req.query.mode)}`);
115
115
}
116
116
};
117
117