orderiom-api-package 0.4.3 → 0.4.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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "orderiom-api-package",
3
- "version": "0.4.3",
3
+ "version": "0.4.5",
4
4
  "description": "This package will install all necessary API calls for every orderiom restaurant",
5
5
  "main": "index.js",
6
6
  "types": "index.d.ts",
@@ -215,9 +215,11 @@ const actions = {
215
215
  }
216
216
  }).then(res => {
217
217
  res.data.data.forEach(productInCategory => {
218
- productInCategory.quantity = state.ShoppingCart
218
+ let quantity = 0;
219
+ state.ShoppingCart
219
220
  .filter(itemInCart => Number(itemInCart.RestaurantProductId) === Number(productInCategory.id))
220
- .reduce((a, b) => a.quantity + b.quantity, 0)
221
+ .forEach((item) => quantity += item.quantity);
222
+ productInCategory.quantity = quantity;
221
223
  });
222
224
  commit("setProduct", res.data.data);
223
225
  return { type: 'success', data: res.data.data }
@@ -289,6 +291,11 @@ const actions = {
289
291
  }
290
292
  }).then((result) => {
291
293
  commit('setProductPackage', result.data.data)
294
+ return {
295
+ type: 'success',
296
+ msg: '',
297
+ data: result.data.data
298
+ }
292
299
  }).catch(
293
300
  commonErrorCallback()
294
301
  );