orderiom-api-package 0.3.23 → 0.3.24

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.23",
3
+ "version": "0.3.24",
4
4
  "description": "This package will install all necessary API calls for every orderiom restaurant",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -33,9 +33,18 @@ const state = () => ({
33
33
  const getters = {
34
34
  subCategories(state){
35
35
  if(!state.products) return []
36
- return Array.from(new Set(state.products.map(productInCategory =>
37
- productInCategory.subcategory_name || 'uncategorised'
38
- )))
36
+ const subCategories = [];
37
+ const ids = Array.from(new Set(state.products.map(productInCategory=>
38
+ productInCategory.subcategory_id
39
+ )))
40
+
41
+ ids.forEach(id=>{
42
+ let filter = state.products.find(i=> i.subcategory_id === id)
43
+ subCategories.push({name: filter.subcategory_name, id: filter.subcategory_id, imagePath: filter.subcategory_image})
44
+ })
45
+
46
+ return subCategories
47
+
39
48
  }
40
49
  }
41
50
  const mutations = {