返回提交历史
Modified
src/controllers/api/artifactsController.ts
+2
-1
XFEstudio/XFESpaceNinjaServer
fix: return new ItemId when converting RawUpgrade to Upgrade (#3669)
Reviewed-on: https://onlyg.it/OpenWF/SpaceNinjaServer/pulls/3669 Co-authored-by: Sainan <63328889+Sainan@users.noreply.github.com> Co-committed-by: Sainan <63328889+Sainan@users.noreply.github.com>
328ff667
代码差异
1 个文件
+2
-1
@@ -38,7 +38,7 @@ export const artifactsController: RequestHandler = async (req, res) => {
38
38
}
39
39
const stringifiedUpgradeFingerprint = JSON.stringify(parsedUpgradeFingerprint);
40
40
41
const itemId = fromOid(ItemId);
41
let itemId = fromOid(ItemId);
42
42
let itemIndex = Upgrades.findIndex(upgrade => upgrade._id.equals(itemId));
43
43
44
44
if (itemIndex !== -1) {
@@ -49,6 +49,7 @@ export const artifactsController: RequestHandler = async (req, res) => {
49
49
UpgradeFingerprint: stringifiedUpgradeFingerprint,
50
50
ItemType
51
51
}) - 1;
52
itemId = Upgrades[itemIndex]._id.toString();
52
53
53
54
addMods(inventory, [{ ItemType, ItemCount: -1 }]);
54
55
}