From 4c45c35f54b4e3f6c7c948f2093173dac10507b1 Mon Sep 17 00:00:00 2001 From: Sainan Date: Sat, 8 Mar 2025 06:28:54 +0100 Subject: [PATCH] fix: claim recipe response The client already 'knows' the ItemCount was decremented so when we also say it in the response, it actually ends up causing the client to think the recipe was used twice. --- src/controllers/api/claimCompletedRecipeController.ts | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/controllers/api/claimCompletedRecipeController.ts b/src/controllers/api/claimCompletedRecipeController.ts index 47d606bf..325d10ff 100644 --- a/src/controllers/api/claimCompletedRecipeController.ts +++ b/src/controllers/api/claimCompletedRecipeController.ts @@ -95,16 +95,12 @@ export const claimCompletedRecipeController: RequestHandler = async (req, res) = let InventoryChanges = {}; if (recipe.consumeOnUse) { - const recipeChanges = [ + addRecipes(inventory, [ { ItemType: pendingRecipe.ItemType, ItemCount: -1 } - ]; - - InventoryChanges = { ...InventoryChanges, Recipes: recipeChanges }; - - addRecipes(inventory, recipeChanges); + ]); } if (req.query.rush) { InventoryChanges = {