orderiom-api-package 0.3.13 → 0.3.15
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 +11 -5
- package/src/modules/product.js +4 -0
package/package.json
CHANGED
package/src/common.js
CHANGED
|
@@ -48,6 +48,7 @@ export function updateBasket({commit, basketId, res, restaurantId}){
|
|
|
48
48
|
|
|
49
49
|
commit(`product/SetShoppingCart`, basketInfo.products, { root: true });
|
|
50
50
|
commit(`product/setDeliveryTime`, basketInfo.deliveryTime, { root: true });
|
|
51
|
+
commit(`product/setServiceDuration`, basketInfo.duration, { root: true });
|
|
51
52
|
commit(`product/setVoucherCode`, basketInfo.voucher_code, { root: true });
|
|
52
53
|
commit(`product/setVoucherValue`, basketInfo.voucherValue, { root: true });
|
|
53
54
|
commit(`product/setTotalWithDiscount`, basketInfo.totalWithDiscount, { root: true });
|
package/src/modules/order.js
CHANGED
|
@@ -161,10 +161,13 @@ const actions = {
|
|
|
161
161
|
} : {}
|
|
162
162
|
|
|
163
163
|
if(basketProduct) basketProduct.changingQuantity = true;
|
|
164
|
+
|
|
165
|
+
data.quantity = parseInt(data.quantity);
|
|
166
|
+
|
|
164
167
|
axios.post("api/basket/add", {
|
|
165
168
|
...basketId,
|
|
166
169
|
productId: data.productId,
|
|
167
|
-
quantity: data.quantity
|
|
170
|
+
quantity: !data.quantity || data.quantity < 1 ? 1 : data.quantity,
|
|
168
171
|
attributeItems: data.attributeItems.length ? data.attributeItems : undefined,
|
|
169
172
|
restaurantId: data.restaurantId,
|
|
170
173
|
extraInfo: data.extraInfo
|
|
@@ -316,10 +319,13 @@ const actions = {
|
|
|
316
319
|
basketId: basket.find((basket) => basket.restaurantId == data.restaurantId).basketId
|
|
317
320
|
} : {}
|
|
318
321
|
|
|
322
|
+
data.quantity = parseInt(data.quantity);
|
|
323
|
+
|
|
319
324
|
if(basketProduct) basketProduct.changingQuantity = true;
|
|
320
325
|
return axios.post('api/basket/add-product-package-items', {
|
|
321
326
|
...basketId,
|
|
322
|
-
...data
|
|
327
|
+
...data,
|
|
328
|
+
quantity: !data.quantity || data.quantity < 1 ? 1 : data.quantity,
|
|
323
329
|
}).then(async () => {
|
|
324
330
|
return await dispatch('shoppingCartUpdateCallback', { restaurantId: data.restaurantId });
|
|
325
331
|
}).catch(
|
|
@@ -582,9 +588,9 @@ const actions = {
|
|
|
582
588
|
.post("api/basket/add-delivery-time", {
|
|
583
589
|
...basketId,
|
|
584
590
|
delivery_time: data.date && data.time ? data.date + " " + data.time : null,
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
591
|
+
deliveryType: data.deliveryType,
|
|
592
|
+
duration: data.duration || undefined,
|
|
593
|
+
restaurantId: data.restaurantId ? data.restaurantId : restaurantIdEnv
|
|
588
594
|
})
|
|
589
595
|
.then((res) => {
|
|
590
596
|
// console.log(res);
|
package/src/modules/product.js
CHANGED
|
@@ -13,6 +13,7 @@ const state = () => ({
|
|
|
13
13
|
SubtotalPrice: null,
|
|
14
14
|
TotalPrice: null,
|
|
15
15
|
deliveryTime: null,
|
|
16
|
+
serviceDuration: null,
|
|
16
17
|
attributes: null,
|
|
17
18
|
attributeItems: null,
|
|
18
19
|
voucherCode: null,
|
|
@@ -67,6 +68,9 @@ const mutations = {
|
|
|
67
68
|
setDeliveryTime(state, time) {
|
|
68
69
|
state.deliveryTime = time;
|
|
69
70
|
},
|
|
71
|
+
setServiceDuration(state, duration){
|
|
72
|
+
state.serviceDuration = duration;
|
|
73
|
+
},
|
|
70
74
|
setAttributes(state, attributes) {
|
|
71
75
|
state.attributes = attributes
|
|
72
76
|
},
|