chore: fix unsafe assignment of any value warning

This commit is contained in:
Sainan 2024-12-30 00:06:31 +01:00
parent 212a5e7035
commit 1c436d9466

View File

@ -26,7 +26,7 @@ interface IGildWeaponRequest {
export const gildWeaponController: RequestHandler = async (req, res) => { export const gildWeaponController: RequestHandler = async (req, res) => {
const accountId = await getAccountIdForRequest(req); const accountId = await getAccountIdForRequest(req);
const data: IGildWeaponRequest = getJSONfromString(String(req.body)); const data = getJSONfromString(String(req.body)) as IGildWeaponRequest;
data.ItemId = String(req.query.ItemId); data.ItemId = String(req.query.ItemId);
if (!modularWeaponCategory.includes(req.query.Category as WeaponTypeInternal | "Hoverboards")) { if (!modularWeaponCategory.includes(req.query.Category as WeaponTypeInternal | "Hoverboards")) {
throw new Error(`Unknown modular weapon Category: ${req.query.Category}`); throw new Error(`Unknown modular weapon Category: ${req.query.Category}`);