chore: address some questionable calls to DocumentArray.id

This commit is contained in:
Sainan 2025-05-09 07:18:25 +02:00
parent 0e255067a8
commit 7a51fab5d3
2 changed files with 2 additions and 2 deletions

View File

@ -104,7 +104,7 @@ export const guildTechController: RequestHandler = async (req, res) => {
) { ) {
throw new Error(`unexpected TechProductCategory: ${data.TechProductCategory}`); 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( throw new Error(
`no item with id ${data.CategoryItemId} in ${getSalvageCategory(data.TechProductCategory)} array` `no item with id ${data.CategoryItemId} in ${getSalvageCategory(data.TechProductCategory)} array`
); );

View File

@ -13,7 +13,7 @@ export const setDojoComponentSettingsController: RequestHandler = async (req, re
res.json({ DojoRequestStatus: -1 }); res.json({ DojoRequestStatus: -1 });
return; return;
} }
const component = guild.DojoComponents.id(req.query.componentId)!; const component = guild.DojoComponents.id(req.query.componentId as string)!;
const data = getJSONfromString<ISetDojoComponentSettingsRequest>(String(req.body)); const data = getJSONfromString<ISetDojoComponentSettingsRequest>(String(req.body));
component.Settings = data.Settings; component.Settings = data.Settings;
await guild.save(); await guild.save();