From 65d1d45ee08ad8ff5a8b5918e1cea999f471943a Mon Sep 17 00:00:00 2001 From: cond0r Date: Fri, 26 Feb 2021 11:01:43 +0200 Subject: [PATCH] Update use-search.tsx --- framework/shopify/product/use-search.tsx | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/framework/shopify/product/use-search.tsx b/framework/shopify/product/use-search.tsx index 1385e9efa..2ff98f25d 100644 --- a/framework/shopify/product/use-search.tsx +++ b/framework/shopify/product/use-search.tsx @@ -37,7 +37,7 @@ export const handler: SWRHook< const { categoryId, brandId } = input const data = await fetch({ - query: categoryId ? getCollectionProductsQuery : options?.query, + query: categoryId ? getCollectionProductsQuery : options.query, method: options?.method, variables: getSearchVariables(input), }) @@ -56,10 +56,8 @@ export const handler: SWRHook< } return { - products: edges?.map(({ node }: ProductEdge) => - normalizeProduct(node as any) - ), - found: !!edges?.length, + products: edges.map(({ node }: ProductEdge) => normalizeProduct(node)), + found: !!edges.length, } }, useHook: ({ useData }) => (input = {}) => {