orderiom-api-package 0.5.3 → 0.5.5
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 +1 -0
- package/src/modules/order.js +2 -14
- package/src/modules/product.js +5 -1
package/package.json
CHANGED
package/src/common.js
CHANGED
|
@@ -63,6 +63,7 @@ export function updateBasket({commit, basketId, res, restaurantId}){
|
|
|
63
63
|
commit(`product/setPostalCode`, basketInfo.postalCode, { root: true });
|
|
64
64
|
commit(`product/setTip`, basketInfo.tip, { root: true });
|
|
65
65
|
commit(`product/setshippingPrice`, basketInfo.shipping_price, { root: true });
|
|
66
|
+
commit(`product/setUnavailableProducts`, basketInfo.unavailableProducts, {root: true});
|
|
66
67
|
|
|
67
68
|
if (parseInt(basketInfo.id) !== parseInt(basketId)) {
|
|
68
69
|
const baskets = JSON.parse(localStorage.getItem('basket'));
|
package/src/modules/order.js
CHANGED
|
@@ -582,7 +582,7 @@ const actions = {
|
|
|
582
582
|
qrCode: data.payfix_qrcode,
|
|
583
583
|
pin: data.payfix_pin,
|
|
584
584
|
}),
|
|
585
|
-
...(data.paymentType === "wallee" && {
|
|
585
|
+
...(data.paymentType === "wallee" && { paymentTypeMethod: data.walleePaymentOption}),
|
|
586
586
|
tablePaymentId: data.tablePaymentId ? data.tablePaymentId : null,
|
|
587
587
|
externalBasketItems: data.externalBasketItems ? data.externalBasketItems : null
|
|
588
588
|
}).then(res => {
|
|
@@ -592,8 +592,7 @@ const actions = {
|
|
|
592
592
|
// commit('setuserOrder', JSON.parse(res.data.data.order.user_details));
|
|
593
593
|
// commit('setshippigPriceOrder', res.data.data.order.shipping_price);
|
|
594
594
|
const basketData = JSON.parse(localStorage.getItem("basket"));
|
|
595
|
-
|
|
596
|
-
if (basketData && isCashPayment) {
|
|
595
|
+
if (basketData) {
|
|
597
596
|
const index = basketId
|
|
598
597
|
? basketData.findIndex(item => Number(item.basketId) === Number(basketId))
|
|
599
598
|
: basketData.findIndex(item => Number(item.restaurantId) === Number(data.restaurantId || restaurantIdEnv()))
|
|
@@ -753,17 +752,6 @@ const actions = {
|
|
|
753
752
|
.then((res) => {
|
|
754
753
|
const status = res.data.data.status;
|
|
755
754
|
commit("setpaymentStatus", status);
|
|
756
|
-
if (status === "success") {
|
|
757
|
-
const basketData = JSON.parse(localStorage.getItem("basket"));
|
|
758
|
-
if (basketData) {
|
|
759
|
-
const basketId = res.data.data.basketId;
|
|
760
|
-
const index = basketData.findIndex(item => Number(item.basketId) === Number(basketId));
|
|
761
|
-
if (index > -1) {
|
|
762
|
-
basketData.splice(index, 1);
|
|
763
|
-
localStorage.setItem("basket", JSON.stringify(basketData));
|
|
764
|
-
}
|
|
765
|
-
}
|
|
766
|
-
}
|
|
767
755
|
// if (status == "paid") {
|
|
768
756
|
// dispatch('createOrder', data.basketId)
|
|
769
757
|
return res;
|
package/src/modules/product.js
CHANGED
|
@@ -32,6 +32,7 @@ const state = () => ({
|
|
|
32
32
|
categoriesFetchedOnce: false,
|
|
33
33
|
pinnedProductsFetchedOnce: false,
|
|
34
34
|
fetchingProductsHappyHour: false,
|
|
35
|
+
unavailableProducts: [] // unavailable products for delivery method
|
|
35
36
|
});
|
|
36
37
|
|
|
37
38
|
function selectedCategoryIsNull(state) {
|
|
@@ -285,7 +286,10 @@ const mutations = {
|
|
|
285
286
|
},
|
|
286
287
|
setFetchingProductsHappyHour(state, value){
|
|
287
288
|
state.fetchingProductsHappyHour = value;
|
|
288
|
-
}
|
|
289
|
+
},
|
|
290
|
+
setUnavailableProducts(state, value) {
|
|
291
|
+
state.unavailableProducts = value;
|
|
292
|
+
}
|
|
289
293
|
};
|
|
290
294
|
const actions = {
|
|
291
295
|
chooseCategory({commit, dispatch, state}, {category, restaurantId}){
|