orderiom-api-package 0.4.5 → 0.4.6

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.5",
3
+ "version": "0.4.6",
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",
@@ -333,7 +333,19 @@ const actions = {
333
333
  return { type: 'error', msg: 'There was an error in updating the delivery type' }
334
334
  }
335
335
 
336
- dispatch('getCategories', (restaurantId || restaurantIdEnv));
336
+ const selectedCategory = rootState.orderiomApiPackage.product.selectedCategory
337
+ if (selectedCategory) {
338
+ dispatch("getProducts", {
339
+ category: selectedCategory,
340
+ restaurantId: restaurantId,
341
+ });
342
+ dispatch("getAttributeItems", {
343
+ category: selectedCategory,
344
+ restaurantId: restaurantId
345
+ });
346
+ } else {
347
+ dispatch('getCategories', (restaurantId || restaurantIdEnv));
348
+ }
337
349
 
338
350
  const result = await dispatch("getBasket", (restaurantId || restaurantIdEnv));
339
351