@viur/shop-components 0.0.1-dev.26 → 0.0.1-dev.28

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@viur/shop-components",
3
- "version": "0.0.1-dev.26",
3
+ "version": "0.0.1-dev.28",
4
4
  "description": "Frontend Vue components for the shop module of ViUR",
5
5
  "repository": {
6
6
  "type": "git",
@@ -251,7 +251,7 @@ async function onConfirm() {
251
251
  confirm.value.hide();
252
252
  }
253
253
 
254
- function updateItem(e) {
254
+ async function updateItem(e) {
255
255
  console.log("updateItem :", e);
256
256
 
257
257
  if (e.quantity === 0) {
@@ -260,6 +260,8 @@ function updateItem(e) {
260
260
  state.currentNode = e.node;
261
261
  } else {
262
262
  cartStore.updateItem(e.articleKey, e.node.key, e.quantity);
263
+
264
+ await updateCart();
263
265
  }
264
266
  }
265
267
 
@@ -277,10 +279,19 @@ async function onDialogHide() {
277
279
  item.quantity = 1;
278
280
  }
279
281
  });
280
- // TODO: await updateCart(state.currentNode.key);
281
282
 
282
283
  state.currentItem = {};
283
284
  state.currentNode = {};
285
+
286
+ await updateCart();
287
+ }
288
+
289
+ async function updateCart() {
290
+ state.nodes = [];
291
+ state.leaves = {};
292
+
293
+ await cartStore.init();
294
+ await getChildren();
284
295
  }
285
296
 
286
297
  async function getChildren(parentKey = props.cartKey) {