orderiom-api-package 0.3.13 → 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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "orderiom-api-package",
3
- "version": "0.3.13",
3
+ "version": "0.3.14",
4
4
  "description": "This package will install all necessary API calls for every orderiom restaurant",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -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 === null || data.quantity === undefined ? 1 : 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(