Fix item quantity increase
This commit is contained in:
parent
57b52b6b50
commit
e8c75b1276
@ -72,7 +72,8 @@ export default function GroceryList() {
|
||||
let newQuantity = quantity;
|
||||
|
||||
const item = await getItemByName(itemName);
|
||||
if (item.data && item.data.item_bought === false) {
|
||||
if (item.data && item.data.bought === false) {
|
||||
console.log("Item exists:", 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}?`
|
||||
|
||||
Loading…
Reference in New Issue
Block a user