orderiom-api-package 0.2.57 → 0.2.58
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 +1 -1
- package/src/common.js +14 -14
- package/src/modules/order.js +3 -4
- package/src/modules/product.js +1 -1
package/package.json
CHANGED
package/src/common.js
CHANGED
|
@@ -38,23 +38,23 @@ export function calculateBasketIdParameter(isLogin) {
|
|
|
38
38
|
return foundBasket.basketId;
|
|
39
39
|
}
|
|
40
40
|
|
|
41
|
-
export function updateBasket({commit
|
|
41
|
+
export function updateBasket({commit, basketId, res, isOutsideProduct}){
|
|
42
42
|
const basketInfo = res.data.data;
|
|
43
|
-
commit('product/
|
|
43
|
+
commit(`${isOutsideProduct ? 'product/' : ''}setBasketInfo`, basketInfo);
|
|
44
44
|
|
|
45
45
|
// TODO: why two separate states use same value?
|
|
46
|
-
commit('product/
|
|
47
|
-
commit('product/
|
|
46
|
+
commit(`${isOutsideProduct ? 'product/' : ''}SetSubtotalPrice`, basketInfo.totalPrice);
|
|
47
|
+
commit(`${isOutsideProduct ? 'product/' : ''}SetTotalPrice`, basketInfo.totalPrice);
|
|
48
48
|
|
|
49
|
-
commit('product/
|
|
50
|
-
commit('product/
|
|
51
|
-
commit('product/
|
|
52
|
-
commit('product/
|
|
53
|
-
commit('product/
|
|
54
|
-
commit('product/
|
|
55
|
-
commit('product/
|
|
56
|
-
commit('product/
|
|
57
|
-
commit('product/
|
|
49
|
+
commit(`${isOutsideProduct ? 'product/' : ''}SetShoppingCart`, basketInfo.products);
|
|
50
|
+
commit(`${isOutsideProduct ? 'product/' : ''}setDeliveryTime`, basketInfo.deliveryTime);
|
|
51
|
+
commit(`${isOutsideProduct ? 'product/' : ''}setVoucherCode`, basketInfo.voucher_code);
|
|
52
|
+
commit(`${isOutsideProduct ? 'product/' : ''}setVoucherValue`, basketInfo.voucherValue);
|
|
53
|
+
commit(`${isOutsideProduct ? 'product/' : ''}setTotalWithDiscount`, basketInfo.totalWithDiscount);
|
|
54
|
+
commit(`${isOutsideProduct ? 'product/' : ''}setDelivertType`, basketInfo.deliveryType);
|
|
55
|
+
commit(`${isOutsideProduct ? 'product/' : ''}setPostalCode`, basketInfo.postalCode);
|
|
56
|
+
commit(`${isOutsideProduct ? 'product/' : ''}setTip`, basketInfo.tip);
|
|
57
|
+
commit(`${isOutsideProduct ? 'product/' : ''}setshippingPrice`, basketInfo.shipping_price);
|
|
58
58
|
|
|
59
59
|
if (parseInt(basketInfo.id) !== parseInt(basketId)) {
|
|
60
60
|
const baskets = JSON.parse(localStorage.getItem('basket'));
|
|
@@ -67,6 +67,6 @@ export function updateBasket({commit}, basketId, res){
|
|
|
67
67
|
localStorage.setItem('basket', JSON.stringify(baskets));
|
|
68
68
|
}
|
|
69
69
|
|
|
70
|
-
commit('product/basketLoadedOnce
|
|
70
|
+
commit(`${isOutsideProduct ? 'product/' : ''}basketLoadedOnce`);
|
|
71
71
|
return true;
|
|
72
72
|
}
|
package/src/modules/order.js
CHANGED
|
@@ -694,7 +694,7 @@ const actions = {
|
|
|
694
694
|
commonErrorCallback()
|
|
695
695
|
);
|
|
696
696
|
},
|
|
697
|
-
editCartProductExtraInfo({rootState, commit},
|
|
697
|
+
editCartProductExtraInfo({rootState, commit}, data){
|
|
698
698
|
let basketId = undefined;
|
|
699
699
|
try{
|
|
700
700
|
basketId = calculateBasketIdParameter(!!rootState.orderiomApiPackage.auth.privateToken);
|
|
@@ -705,10 +705,9 @@ const actions = {
|
|
|
705
705
|
|
|
706
706
|
axios.post('api/basket/update-extraInfo', {
|
|
707
707
|
basketId,
|
|
708
|
-
|
|
709
|
-
extraInfo
|
|
708
|
+
...data
|
|
710
709
|
}).then(res =>
|
|
711
|
-
updateBasket({commit
|
|
710
|
+
updateBasket({commit, basketId, res, isOutsideProduct: true})
|
|
712
711
|
).catch(
|
|
713
712
|
commonErrorCallback()
|
|
714
713
|
);
|
package/src/modules/product.js
CHANGED