orderiom-api-package 0.4.105 → 0.4.107

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": "orderiom-api-package",
3
- "version": "0.4.105",
3
+ "version": "0.4.107",
4
4
  "description": "This package will install all necessary API calls for every orderiom restaurant",
5
5
  "main": "index.js",
6
6
  "types": "index.d.ts",
@@ -558,10 +558,6 @@ const actions = {
558
558
  }
559
559
  }
560
560
 
561
- commit("product/SetShoppingCart", [], {root: true});
562
- commit("product/setBasketInfo", {}, {root: true});
563
- commit("product/setDeliveryTime", "", {root: true});
564
-
565
561
  const classicRedirect = (res) => {
566
562
  window.location = res.data.data.paymentLink;
567
563
  return res;
@@ -585,7 +581,15 @@ const actions = {
585
581
  name = typeof data.routeName === 'string' ? null : data.routeName['payment']
586
582
  }
587
583
 
588
- if(!name) return classicRedirect(res);
584
+ if(!name) {
585
+ classicRedirect(res);
586
+
587
+ commit("product/SetShoppingCart", [], {root: true});
588
+ commit("product/setBasketInfo", {}, {root: true});
589
+ commit("product/setDeliveryTime", "", {root: true});
590
+
591
+ return
592
+ }
589
593
 
590
594
  data.$router.push({
591
595
  name,
@@ -598,6 +602,10 @@ const actions = {
598
602
  result[element[0]] = element[1];
599
603
  return result;
600
604
  }, {}),
605
+ }).then(() => {
606
+ commit("product/SetShoppingCart", [], {root: true});
607
+ commit("product/setBasketInfo", {}, {root: true});
608
+ commit("product/setDeliveryTime", "", {root: true});
601
609
  });
602
610
  }).catch(error => {
603
611
  const status = error.response ? error.response.status : null;