orderiom-api-package
Advanced tools
Comparing version 0.3.8 to 0.3.9
{ | ||
"name": "orderiom-api-package", | ||
"version": "0.3.8", | ||
"version": "0.3.9", | ||
"description": "This package will install all necessary API calls for every orderiom restaurant", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -43,17 +43,18 @@ export const restaurantIdEnv = process.env.VUE_APP_RESTAURANT_ID ? parseInt(process.env.VUE_APP_RESTAURANT_ID) : null; | ||
const basketInfo = res.data.data; | ||
commit(`${isOutsideProduct ? 'product/' : ''}setBasketInfo`, basketInfo); | ||
const scope = isOutsideProduct ? 'product/' : ''; | ||
commit(`${scope}setBasketInfo`, basketInfo); | ||
// TODO: why two separate states use same value? | ||
commit(`${isOutsideProduct ? 'product/' : ''}SetSubtotalPrice`, basketInfo.totalPrice); | ||
commit(`${isOutsideProduct ? 'product/' : ''}SetTotalPrice`, basketInfo.totalPrice); | ||
commit(`${scope}SetSubtotalPrice`, basketInfo.totalPrice); | ||
commit(`${scope}SetTotalPrice`, basketInfo.totalPrice); | ||
commit(`${isOutsideProduct ? 'product/' : ''}SetShoppingCart`, basketInfo.products); | ||
commit(`${isOutsideProduct ? 'product/' : ''}setDeliveryTime`, basketInfo.deliveryTime); | ||
commit(`${isOutsideProduct ? 'product/' : ''}setVoucherCode`, basketInfo.voucher_code); | ||
commit(`${isOutsideProduct ? 'product/' : ''}setVoucherValue`, basketInfo.voucherValue); | ||
commit(`${isOutsideProduct ? 'product/' : ''}setTotalWithDiscount`, basketInfo.totalWithDiscount); | ||
commit(`${isOutsideProduct ? 'product/' : ''}setDelivertType`, basketInfo.deliveryType); | ||
commit(`${isOutsideProduct ? 'product/' : ''}setPostalCode`, basketInfo.postalCode); | ||
commit(`${isOutsideProduct ? 'product/' : ''}setTip`, basketInfo.tip); | ||
commit(`${isOutsideProduct ? 'product/' : ''}setshippingPrice`, basketInfo.shipping_price); | ||
commit(`${scope}SetShoppingCart`, basketInfo.products); | ||
commit(`${scope}setDeliveryTime`, basketInfo.deliveryTime); | ||
commit(`${scope}setVoucherCode`, basketInfo.voucher_code); | ||
commit(`${scope}setVoucherValue`, basketInfo.voucherValue); | ||
commit(`${scope}setTotalWithDiscount`, basketInfo.totalWithDiscount); | ||
commit(`${scope}setDelivertType`, basketInfo.deliveryType); | ||
commit(`${scope}setPostalCode`, basketInfo.postalCode); | ||
commit(`${scope}setTip`, basketInfo.tip); | ||
commit(`${scope}setshippingPrice`, basketInfo.shipping_price); | ||
@@ -60,0 +61,0 @@ if (parseInt(basketInfo.id) !== parseInt(basketId)) { |
@@ -719,2 +719,3 @@ import axios from "axios"; | ||
basketId, | ||
restaurantId: data.restaurantId || restaurantIdEnv, | ||
...data | ||
@@ -721,0 +722,0 @@ }).then(res => |
2261
94637