diff --git a/src/store/modules/product/actions.ts b/src/store/modules/product/actions.ts index 354473df..391015bf 100644 --- a/src/store/modules/product/actions.ts +++ b/src/store/modules/product/actions.ts @@ -97,10 +97,17 @@ const actions: ActionTree = { if(currentProduct) { commit(types.PRODUCT_CURRENT_UPDATED, { product: currentProduct }) } else { - const resp = await ProductService.fetchProducts({ - // used sku as we are currently only using sku to search for the product - "filters": ['sku: ' + payload, 'isVirtual: false'], - }) + // used sku as we are currently only using sku to search for the product + const params = { + filters: { + isVirtual: { value: 'false' }, + sku: { value: payload } + } + } + const productQueryPayload = prepareProductQuery(params) + + const resp = await ProductService.fetchProducts(productQueryPayload) + if(resp.status === 200 && !hasError(resp) && resp.data.response?.numFound > 0) { commit(types.PRODUCT_CURRENT_UPDATED, { product: resp.data.response.docs[0] }) } else {