From 92d53e1c00570fc70e15a243f8f70c46f93ae748 Mon Sep 17 00:00:00 2001 From: Sainan Date: Sat, 8 Mar 2025 06:29:05 -0800 Subject: [PATCH] chore: improve addMissionInventoryUpdates (#1121) Closes #1119 Reviewed-on: https://onlyg.it/OpenWF/SpaceNinjaServer/pulls/1121 Co-authored-by: Sainan Co-committed-by: Sainan --- src/services/missionInventoryUpdateService.ts | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/services/missionInventoryUpdateService.ts b/src/services/missionInventoryUpdateService.ts index 6c27d51e..c9986c38 100644 --- a/src/services/missionInventoryUpdateService.ts +++ b/src/services/missionInventoryUpdateService.ts @@ -65,12 +65,8 @@ const getRandomRewardByChance = (pool: IReward[]): IRngResult | undefined => { export const addMissionInventoryUpdates = async ( inventory: HydratedDocument, inventoryUpdates: IMissionInventoryUpdateRequest -): Promise | undefined> => { - //TODO: type this properly - const inventoryChanges: Partial = {}; - if (inventoryUpdates.MissionFailed === true) { - return; - } +): Promise => { + const inventoryChanges: IInventoryChanges = {}; if (inventoryUpdates.RewardInfo && inventoryUpdates.RewardInfo.periodicMissionTag) { const tag = inventoryUpdates.RewardInfo.periodicMissionTag; const existingCompletion = inventory.PeriodicMissionCompletions.find(completion => completion.tag === tag);