From ca55b21a2a255b3f58d4ac73287e6b82a5d608e6 Mon Sep 17 00:00:00 2001 From: Sainan Date: Wed, 26 Feb 2025 15:42:25 -0800 Subject: [PATCH] fix: display bug when activating riven via mods console (#1034) Reviewed-on: https://onlyg.it/OpenWF/SpaceNinjaServer/pulls/1034 --- src/controllers/api/activateRandomModController.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/controllers/api/activateRandomModController.ts b/src/controllers/api/activateRandomModController.ts index cb84feba5..02feb87eb 100644 --- a/src/controllers/api/activateRandomModController.ts +++ b/src/controllers/api/activateRandomModController.ts @@ -1,3 +1,4 @@ +import { toOid } from "@/src/helpers/inventoryHelpers"; import { getJSONfromString } from "@/src/helpers/stringHelpers"; import { addMods, getInventory } from "@/src/services/inventoryService"; import { getAccountIdForRequest } from "@/src/services/loginService"; @@ -47,8 +48,13 @@ export const activateRandomModController: RequestHandler = async (req, res) => { UpgradeFingerprint: JSON.stringify({ challenge: fingerprintChallenge }) }) - 1; await inventory.save(); + // For some reason, in this response, the UpgradeFingerprint is simply a nested object and not a string res.json({ - NewMod: inventory.Upgrades[upgradeIndex].toJSON() + NewMod: { + UpgradeFingerprint: { challenge: fingerprintChallenge }, + ItemType: inventory.Upgrades[upgradeIndex].ItemType, + ItemId: toOid(inventory.Upgrades[upgradeIndex]._id) + } }); };