Skip to content

Commit

Permalink
Implement ShopperSearch SCAPI hook (#719)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
shethj authored Sep 15, 2022
1 parent e27e932 commit 158b357
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/commerce-sdk-react/src/hooks/ShopperSearch/query.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ function useProductSearch(
function useProductSearch(
arg: UseProductSearchArg,
options?: UseQueryOptions<DataType<Client['productSearch']> | Response, Error>
) {
): UseQueryResult<DataType<Client['productSearch']> | Response, Error> {
const {headers, rawResponse, ...parameters} = arg
return useAsync(
['productSearch', arg],
Expand Down Expand Up @@ -71,7 +71,7 @@ function useSearchSuggestions(
function useSearchSuggestions(
arg: UseSearchSuggestionsArg,
options?: UseQueryOptions<DataType<Client['getSearchSuggestions']> | Response, Error>
) {
): UseQueryResult<DataType<Client['getSearchSuggestions']> | Response, Error> {
const {headers, rawResponse, ...parameters} = arg
return useAsync(
['search-suggestions', arg],
Expand Down

0 comments on commit 158b357

Please sign in to comment.