From 7a51fab5d3d6c2ed8e7960e0f916840280875171 Mon Sep 17 00:00:00 2001 From: Sainan <63328889+Sainan@users.noreply.github.com> Date: Fri, 9 May 2025 07:18:25 +0200 Subject: [PATCH] chore: address some questionable calls to DocumentArray.id --- src/controllers/api/guildTechController.ts | 2 +- src/controllers/api/setDojoComponentSettingsController.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/controllers/api/guildTechController.ts b/src/controllers/api/guildTechController.ts index 821831d4..49d96b70 100644 --- a/src/controllers/api/guildTechController.ts +++ b/src/controllers/api/guildTechController.ts @@ -104,7 +104,7 @@ export const guildTechController: RequestHandler = async (req, res) => { ) { throw new Error(`unexpected TechProductCategory: ${data.TechProductCategory}`); } - if (!inventory[getSalvageCategory(data.TechProductCategory)].id(data.CategoryItemId)) { + if (!inventory[getSalvageCategory(data.TechProductCategory)].id(data.CategoryItemId!)) { throw new Error( `no item with id ${data.CategoryItemId} in ${getSalvageCategory(data.TechProductCategory)} array` ); diff --git a/src/controllers/api/setDojoComponentSettingsController.ts b/src/controllers/api/setDojoComponentSettingsController.ts index e7118415..1286ba25 100644 --- a/src/controllers/api/setDojoComponentSettingsController.ts +++ b/src/controllers/api/setDojoComponentSettingsController.ts @@ -13,7 +13,7 @@ export const setDojoComponentSettingsController: RequestHandler = async (req, re res.json({ DojoRequestStatus: -1 }); return; } - const component = guild.DojoComponents.id(req.query.componentId)!; + const component = guild.DojoComponents.id(req.query.componentId as string)!; const data = getJSONfromString(String(req.body)); component.Settings = data.Settings; await guild.save();