XFE Git
XFE Studio Git
Git 首页 全局搜索
XFE 主站 文档 NuGet

XFESpaceNinjaServer

A simple server for a small space ninja game

公开
关注 0 Fork 0 Star 0
返回提交历史

XFEstudio/XFESpaceNinjaServer

chore: use updateOne for active focus way change

943edf70
Sainan <sainan@calamity.inc>
提交于

代码差异

1 个文件 +11 -3
Modified src/controllers/api/focusController.ts +11 -3
@@ -5,6 +5,7 @@ import { IMiscItem, TFocusPolarity, TEquipmentKey, InventorySlot } from "@/src/t
5 5 import { logger } from "@/src/utils/logger";
6 6 import { ExportFocusUpgrades } from "warframe-public-export-plus";
7 7 import { IEquipmentClient } from "@/src/types/inventoryTypes/commonInventoryTypes";
8 import { Inventory } from "@/src/models/inventoryModels/inventoryModel";
8 9
9 10 export const focusController: RequestHandler = async (req, res) => {
10 11 const accountId = await getAccountIdForRequest(req);
@@ -55,9 +56,16 @@ export const focusController: RequestHandler = async (req, res) => {
55 56 }
56 57 case FocusOperation.ActivateWay: {
57 58 const focusType = (JSON.parse(String(req.body)) as IWayRequest).FocusType;
58 const inventory = await getInventory(accountId);
59 inventory.FocusAbility = focusType;
60 await inventory.save();
59
60 await Inventory.updateOne(
61 {
62 accountOwnerId: accountId
63 },
64 {
65 FocusAbility: focusType
66 }
67 );
68
61 69 res.end();
62 70 break;
63 71 }