orderiom-api-package 0.4.65 → 0.4.67
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 +1 -1
- package/src/modules/product.js +15 -11
package/package.json
CHANGED
package/src/modules/product.js
CHANGED
|
@@ -37,15 +37,19 @@ const getters = {
|
|
|
37
37
|
return !!state.fetchingProducts;
|
|
38
38
|
},
|
|
39
39
|
subCategories(state){
|
|
40
|
-
if(!state.products) return []
|
|
41
40
|
if(state.showPinnedProducts) {
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
41
|
+
if(state.pinnedProducts?.length){
|
|
42
|
+
return [{
|
|
43
|
+
id: null,
|
|
44
|
+
imagePath:null,
|
|
45
|
+
name:null,
|
|
46
|
+
priority:null
|
|
47
|
+
}]
|
|
48
|
+
}else{
|
|
49
|
+
return []
|
|
50
|
+
}
|
|
48
51
|
}
|
|
52
|
+
if(!state.products?.length) return []
|
|
49
53
|
const subCategories = [];
|
|
50
54
|
const ids = Array.from(new Set(state.products.map(productInCategory=>
|
|
51
55
|
productInCategory.subcategory_id
|
|
@@ -315,14 +319,14 @@ const actions = {
|
|
|
315
319
|
}
|
|
316
320
|
}).catch(
|
|
317
321
|
commonErrorCallback()
|
|
318
|
-
)
|
|
322
|
+
).finally(() => {
|
|
323
|
+
commit('setCategoriesFetchedOnce');
|
|
324
|
+
});
|
|
319
325
|
|
|
320
326
|
return res
|
|
321
327
|
}).catch(
|
|
322
328
|
commonErrorCallback()
|
|
323
|
-
)
|
|
324
|
-
commit('setCategoriesFetchedOnce');
|
|
325
|
-
});
|
|
329
|
+
);
|
|
326
330
|
},
|
|
327
331
|
getProducts({ commit, state, rootState }, data) {
|
|
328
332
|
commit("setSelectedCategory", data.category);
|