This commit is contained in:
cond0r
2021-05-28 10:28:24 +03:00
parent 9309ca9487
commit ca703ad2a0
7 changed files with 33 additions and 21 deletions

View File

@@ -1,7 +1,6 @@
import { SWRHook } from '@commerce/utils/types'
import { Product } from '@commerce/types'
import useSearch, { UseSearch } from '@commerce/product/use-search'
import { SearchProductsInput, SearchProductsData } from '@commerce/types'
import { ProductEdge } from '../schema'
import {
@@ -11,6 +10,19 @@ import {
normalizeProduct,
} from '../utils'
export type SearchProductsInput = {
search?: string
categoryId?: string
brandId?: string
sort?: string
locale?: string
}
export type SearchProductsData = {
products: Product[]
found: boolean
}
export default useSearch as UseSearch<typeof handler>
export const handler: SWRHook<