From f4e784b2ec1ec7312d93fa819eefdcf6539f6198 Mon Sep 17 00:00:00 2001 From: Nico Date: Sun, 23 Nov 2025 09:03:07 -0800 Subject: [PATCH] Fix adding non-existent item --- frontend/src/pages/GroceryList.jsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/src/pages/GroceryList.jsx b/frontend/src/pages/GroceryList.jsx index 0de1353..07d5682 100644 --- a/frontend/src/pages/GroceryList.jsx +++ b/frontend/src/pages/GroceryList.jsx @@ -72,7 +72,7 @@ export default function GroceryList() { let newQuantity = quantity; const item = await getItemByName(itemName); - if (item) { + if (item.data) { let currentQuantity = item.data.quantity; const yes = window.confirm( `Item "${itemName}" already exists in the list. Do you want to update its quantity from ${currentQuantity} to ${currentQuantity + newQuantity}?`