summaryrefslogtreecommitdiff
path: root/iridescence/src/store/index.js
diff options
context:
space:
mode:
Diffstat (limited to 'iridescence/src/store/index.js')
-rw-r--r--iridescence/src/store/index.js10
1 files changed, 3 insertions, 7 deletions
diff --git a/iridescence/src/store/index.js b/iridescence/src/store/index.js
index 5a5b5f7..0e5d3be 100644
--- a/iridescence/src/store/index.js
+++ b/iridescence/src/store/index.js
@@ -13,13 +13,10 @@ export default new Vuex.Store({
},
getters: {
products(state) {
- const searchTerm = state.searchTerm.toLowerCase();
-
return state.products.filter(item => {
- return (
- item.name.toLowerCase().indexOf(searchTerm) != -1 ||
- item.description.toLowerCase().indexOf(searchTerm) != -1
- );
+ return JSON.stringify(item)
+ .toLowerCase()
+ .includes(state.searchTerm.toLowerCase());
});
}
},
@@ -33,7 +30,6 @@ export default new Vuex.Store({
},
actions: {
refreshProducts(context) {
- context.commit("setProducts", []);
context.commit("setProducts", dichroismApi.getProducts());
},
updateProduct(context, product) {