orderiom-api-package 0.3.11 → 0.3.14
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/modules/order.js +10 -4
package/package.json
CHANGED
package/src/modules/order.js
CHANGED
|
@@ -106,7 +106,7 @@ const actions = {
|
|
|
106
106
|
.then(async res => {
|
|
107
107
|
basketData.push({
|
|
108
108
|
restaurantId: restaurantIdEnv,
|
|
109
|
-
basketId: res.data.data.
|
|
109
|
+
basketId: res.data.data.basketId,
|
|
110
110
|
});
|
|
111
111
|
localStorage.setItem("basket", JSON.stringify(basketData));
|
|
112
112
|
const result = await dispatch('product/getBasket', restaurantIdEnv, { root: true }) ;
|
|
@@ -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: 1,
|
|
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(
|
|
@@ -731,4 +737,4 @@ export default {
|
|
|
731
737
|
state,
|
|
732
738
|
mutations,
|
|
733
739
|
actions
|
|
734
|
-
};
|
|
740
|
+
};
|