chore: use updateOne for active focus way change
All checks were successful
Build / build (22) (push) Successful in 39s
Build / build (18) (push) Successful in 1m7s
Build / build (20) (push) Successful in 1m4s
Build Docker image / docker (push) Successful in 32s

This commit is contained in:
Sainan 2025-03-16 16:41:39 +01:00
parent 1d23f2736f
commit 943edf7065

View File

@ -5,6 +5,7 @@ import { IMiscItem, TFocusPolarity, TEquipmentKey, InventorySlot } from "@/src/t
import { logger } from "@/src/utils/logger"; import { logger } from "@/src/utils/logger";
import { ExportFocusUpgrades } from "warframe-public-export-plus"; import { ExportFocusUpgrades } from "warframe-public-export-plus";
import { IEquipmentClient } from "@/src/types/inventoryTypes/commonInventoryTypes"; import { IEquipmentClient } from "@/src/types/inventoryTypes/commonInventoryTypes";
import { Inventory } from "@/src/models/inventoryModels/inventoryModel";
export const focusController: RequestHandler = async (req, res) => { export const focusController: RequestHandler = async (req, res) => {
const accountId = await getAccountIdForRequest(req); const accountId = await getAccountIdForRequest(req);
@ -55,9 +56,16 @@ export const focusController: RequestHandler = async (req, res) => {
} }
case FocusOperation.ActivateWay: { case FocusOperation.ActivateWay: {
const focusType = (JSON.parse(String(req.body)) as IWayRequest).FocusType; const focusType = (JSON.parse(String(req.body)) as IWayRequest).FocusType;
const inventory = await getInventory(accountId);
inventory.FocusAbility = focusType; await Inventory.updateOne(
await inventory.save(); {
accountOwnerId: accountId
},
{
FocusAbility: focusType
}
);
res.end(); res.end();
break; break;
} }