From 158b357806cce7c37670a208b8fffffebfbd3fe6 Mon Sep 17 00:00:00 2001 From: Jainam Sheth <99490559+shethj@users.noreply.github.com> Date: Thu, 15 Sep 2022 13:48:22 -0400 Subject: [PATCH] Implement ShopperSearch SCAPI hook (#719) * Implemented productSearch and searchSugesstions hooks * Implement productSearch and searchSuggestions hooks * Added route for search-suggestions in hooks test app * Refactor shopperSearch hooks to use slas hooks callback for client * Added unit tests for ShopperSearch SCAPI hooks * Added unit tests for ShopperSearch hooks * Fix lint errors * Fix lint errors * Added .gitattributes to mark mock-responses as generated * Removed ts-ignore from ShopperProducts hook * Remove vscode config files * Mark individual mock-responses files as 'generated' * Update folder path for mock-responses * Remove redundant optional operator in ShopperSearch hook * Remove redundant ? from search hooks * FIx redundant ? in Search hooks * Added return types for ShopperSearch hooks implementation signature --- packages/commerce-sdk-react/src/hooks/ShopperSearch/query.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/commerce-sdk-react/src/hooks/ShopperSearch/query.ts b/packages/commerce-sdk-react/src/hooks/ShopperSearch/query.ts index 5c0b5f351e..6f8c761c61 100644 --- a/packages/commerce-sdk-react/src/hooks/ShopperSearch/query.ts +++ b/packages/commerce-sdk-react/src/hooks/ShopperSearch/query.ts @@ -36,7 +36,7 @@ function useProductSearch( function useProductSearch( arg: UseProductSearchArg, options?: UseQueryOptions | Response, Error> -) { +): UseQueryResult | Response, Error> { const {headers, rawResponse, ...parameters} = arg return useAsync( ['productSearch', arg], @@ -71,7 +71,7 @@ function useSearchSuggestions( function useSearchSuggestions( arg: UseSearchSuggestionsArg, options?: UseQueryOptions | Response, Error> -) { +): UseQueryResult | Response, Error> { const {headers, rawResponse, ...parameters} = arg return useAsync( ['search-suggestions', arg],