orderiom-api-package 0.2.40 → 0.2.41

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.2.40",
3
+ "version": "0.2.41",
4
4
  "description": "this package will install all neccessary api calls for every orderiom restaurant",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -129,6 +129,9 @@ const actions = {
129
129
  }
130
130
  return foundBasket.basketId;
131
131
  },
132
+ // TODO: note the axios in loop
133
+ // Orderiom api doesn't use this function
134
+ // check whether ordermood is using this function or not
132
135
  getCategoriesWithProducts({ commit, dispatch }, restaurantId) {
133
136
  return axios
134
137
  .get("api/restaurant/category", { params: { restaurantId: restaurantId } })
@@ -193,6 +196,8 @@ const actions = {
193
196
  .get("api/restaurant/category", { params: { restaurantId: restaurantId } })
194
197
  .then((res) => {
195
198
  let categories = res.data.data;
199
+ //TODO: why calling an api write after another while we can do it together?
200
+ //TODO: this api call returns empty on restaurant refresh
196
201
  axios
197
202
  .get("api/restaurant/category", { params: { restaurantId: restaurantId, extra: 1 } })
198
203
  .then((res) => {
@@ -470,6 +475,11 @@ const actions = {
470
475
  return { type: 'error', msg: 'There was an error in updating the delivery type' }
471
476
  }
472
477
 
478
+ dispatch('getProducts', {
479
+ restaurantId,
480
+ category: state.selectedCategory || state.categories[0]
481
+ });
482
+
473
483
  const result = await dispatch("getBasket", restaurantId);
474
484
 
475
485
  return {