diff --git a/framework/bigcommerce/product/use-search.tsx b/framework/bigcommerce/product/use-search.tsx index c9ac8f9a0..3c81d1171 100644 --- a/framework/bigcommerce/product/use-search.tsx +++ b/framework/bigcommerce/product/use-search.tsx @@ -22,9 +22,9 @@ export const handler: SWRHook = { if (search) url.searchParams.set('search', search) if (Number.isInteger(categoryId)) - url.searchParams.set('category', String(categoryId)) + url.searchParams.set('categoryId', String(categoryId)) if (Number.isInteger(brandId)) - url.searchParams.set('brand', String(brandId)) + url.searchParams.set('brandId', String(brandId)) if (sort) url.searchParams.set('sort', sort) return fetch({ diff --git a/framework/commerce/types/product.ts b/framework/commerce/types/product.ts index 782f2a31a..27e98598a 100644 --- a/framework/commerce/types/product.ts +++ b/framework/commerce/types/product.ts @@ -55,7 +55,10 @@ export type ProductTypes = { } export type SearchProductsHook = { - data: T['product'][] + data: { + products: T['product'][] + found: boolean + } body: T['searchBody'] input: T['searchBody'] fetcherInput: T['searchBody'] @@ -65,13 +68,7 @@ export type ProductsSchema = { endpoint: { options: {} handlers: { - getProducts: { - data: { - products: T['product'][] - found: boolean - } - body: SearchProductsHook['body'] - } + getProducts: SearchProductsHook } } } diff --git a/pages/search.tsx b/pages/search.tsx index 53452b74a..400217a26 100644 --- a/pages/search.tsx +++ b/pages/search.tsx @@ -18,7 +18,6 @@ import { getDesignerPath, useSearchMeta, } from '@lib/search' -import { Product } from '@commerce/types' // TODO(bc) Remove this. This should come from the API import getSlug from '@lib/get-slug'