From 78daddbbbee1b67bbf3960e3d4d08d0757547207 Mon Sep 17 00:00:00 2001 From: "Adam T. Carpenter" Date: Sat, 12 Sep 2020 17:26:25 -0400 Subject: Working product name updating; working mock Dichroism API. --- iridescence/src/store/index.js | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) (limited to 'iridescence/src/store') 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) { -- cgit v1.2.3