forked from OpenWF/SpaceNinjaServer
chore: use updateOne for active focus way change
This commit is contained in:
parent
1d23f2736f
commit
943edf7065
@ -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;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user