Fix loading of carts, only add items for which lookup succeeds.

This commit is contained in:
Mario Zechner 2023-06-28 11:15:34 +02:00
parent bb11db1520
commit f5998383f5
2 changed files with 20 additions and 21 deletions

View File

@ -55,8 +55,7 @@ class Carts extends Model {
const items = [];
for (const cartItem of cart.items) {
const item = itemsLookup[cartItem.store + cartItem.id];
if (!item) items.push(cartItem);
else items.push(item);
if (item) items.push(item);
}
cart.items = items;
}

View File

@ -399,13 +399,13 @@
"code": "34"
},
{
"id": "joghurt-topfen",
"url": "https://www.roksh.at/hofer/angebot/joghurt-topfen",
"id": "milch-sahne-butter",
"url": "https://www.roksh.at/hofer/angebot/milch-sahne-butter",
"code": "34"
},
{
"id": "milch-sahne-butter",
"url": "https://www.roksh.at/hofer/angebot/milch-sahne-butter",
"id": "joghurt-topfen",
"url": "https://www.roksh.at/hofer/angebot/joghurt-topfen",
"code": "34"
},
{
@ -484,13 +484,13 @@
"code": "32"
},
{
"id": "rind",
"url": "https://www.roksh.at/hofer/angebot/rind",
"id": "faschiertes",
"url": "https://www.roksh.at/hofer/angebot/faschiertes",
"code": "32"
},
{
"id": "faschiertes",
"url": "https://www.roksh.at/hofer/angebot/faschiertes",
"id": "rind",
"url": "https://www.roksh.at/hofer/angebot/rind",
"code": "32"
},
{
@ -503,19 +503,14 @@
"url": "https://www.roksh.at/hofer/angebot/honig-nussaufstriche",
"code": "56"
},
{
"id": "obstkonserven",
"url": "https://www.roksh.at/hofer/angebot/obstkonserven",
"code": "57"
},
{
"id": "gemusekonserven",
"url": "https://www.roksh.at/hofer/angebot/gemusekonserven",
"code": "57"
},
{
"id": "fleisch-fischkonserven",
"url": "https://www.roksh.at/hofer/angebot/fleisch-fischkonserven",
"id": "obstkonserven",
"url": "https://www.roksh.at/hofer/angebot/obstkonserven",
"code": "57"
},
{
@ -523,6 +518,11 @@
"url": "https://www.roksh.at/hofer/angebot/sauerkonserven",
"code": "57"
},
{
"id": "fleisch-fischkonserven",
"url": "https://www.roksh.at/hofer/angebot/fleisch-fischkonserven",
"code": "57"
},
{
"id": "nusse",
"url": "https://www.roksh.at/hofer/angebot/nusse",
@ -629,13 +629,13 @@
"code": "20"
},
{
"id": "smoothies",
"url": "https://www.roksh.at/hofer/angebot/smoothies",
"id": "sirupe",
"url": "https://www.roksh.at/hofer/angebot/sirupe",
"code": "20"
},
{
"id": "sirupe",
"url": "https://www.roksh.at/hofer/angebot/sirupe",
"id": "smoothies",
"url": "https://www.roksh.at/hofer/angebot/smoothies",
"code": "20"
},
{