返回提交历史
Modified
src/controllers/api/claimCompletedRecipeController.ts
+5
-2
XFEstudio/XFESpaceNinjaServer
fix: provide proper response when unbranding a suit (#1697)
Fixes #1695 Reviewed-on: https://onlyg.it/OpenWF/SpaceNinjaServer/pulls/1697 Co-authored-by: Sainan <63328889+Sainan@users.noreply.github.com> Co-committed-by: Sainan <63328889+Sainan@users.noreply.github.com>
0d8f5ee6
代码差异
1 个文件
+5
-2
@@ -18,6 +18,7 @@ import {
18
18
import { IInventoryChanges } from "@/src/types/purchaseTypes";
19
19
import { IEquipmentClient } from "@/src/types/inventoryTypes/commonInventoryTypes";
20
20
import { InventorySlot } from "@/src/types/inventoryTypes/inventoryTypes";
21
import { toOid } from "@/src/helpers/inventoryHelpers";
21
22
22
23
interface IClaimCompletedRecipeRequest {
23
24
RecipeIds: IOid[];
@@ -80,6 +81,7 @@ export const claimCompletedRecipeController: RequestHandler = async (req, res) =
80
81
} else {
81
82
logger.debug("Claiming Recipe", { recipe, pendingRecipe });
82
83
84
let BrandedSuits: undefined | IOid[];
83
85
if (recipe.secretIngredientAction == "SIA_SPECTRE_LOADOUT_COPY") {
84
86
inventory.PendingSpectreLoadouts ??= [];
85
87
inventory.SpectreLoadouts ??= [];
@@ -104,9 +106,10 @@ export const claimCompletedRecipeController: RequestHandler = async (req, res) =
104
106
inventory.BrandedSuits!.findIndex(x => x.equals(pendingRecipe.SuitToUnbrand)),
105
107
1
106
108
);
109
BrandedSuits = [toOid(pendingRecipe.SuitToUnbrand!)];
107
110
}
108
111
109
let InventoryChanges = {};
112
let InventoryChanges: IInventoryChanges = {};
110
113
if (recipe.consumeOnUse) {
111
114
addRecipes(inventory, [
112
115
{
@@ -134,6 +137,6 @@ export const claimCompletedRecipeController: RequestHandler = async (req, res) =
134
137
};
135
138
}
136
139
await inventory.save();
137
res.json({ InventoryChanges });
140
res.json({ InventoryChanges, BrandedSuits });
138
141
}
139
142
};