fix addXpController
This commit is contained in:
parent
7fa299a57e
commit
e305399ba6
@ -1,5 +1,6 @@
|
||||
import { applyClientEquipmentUpdates, getInventory } from "@/src/services/inventoryService";
|
||||
import { getAccountIdForRequest } from "@/src/services/loginService";
|
||||
import { IOid } from "@/src/types/commonTypes";
|
||||
import { IEquipmentClient } from "@/src/types/inventoryTypes/commonInventoryTypes";
|
||||
import { TEquipmentKey } from "@/src/types/inventoryTypes/inventoryTypes";
|
||||
import { RequestHandler } from "express";
|
||||
@ -11,7 +12,7 @@ export const addXpController: RequestHandler = async (req, res) => {
|
||||
const request = req.body as IAddXpRequest;
|
||||
for (const [category, gear] of Object.entries(request)) {
|
||||
for (const clientItem of gear) {
|
||||
const dbItem = inventory[category as TEquipmentKey].id(clientItem.ItemId.$oid);
|
||||
const dbItem = inventory[category as TEquipmentKey].id((clientItem.ItemId as IOid).$oid);
|
||||
if (dbItem) {
|
||||
if (dbItem.ItemType in ExportMisc.uniqueLevelCaps) {
|
||||
if ((dbItem.Polarized ?? 0) < 5) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user