@hotfix/fixing brand id in use-search

to set searchParam brand, should check brandId and not categoryId
This commit is contained in:
mohux 2021-01-22 02:40:52 +03:00
parent 742ac5786e
commit c14a83cbbf

View File

@ -26,8 +26,7 @@ export const fetcher: HookFetcher<SearchProductsData, SearchProductsInput> = (
if (search) url.searchParams.set('search', search) if (search) url.searchParams.set('search', search)
if (Number.isInteger(categoryId)) if (Number.isInteger(categoryId))
url.searchParams.set('category', String(categoryId)) url.searchParams.set('category', String(categoryId))
if (Number.isInteger(categoryId)) if (Number.isInteger(brandId)) url.searchParams.set('brand', String(brandId))
url.searchParams.set('brand', String(brandId))
if (sort) url.searchParams.set('sort', sort) if (sort) url.searchParams.set('sort', sort)
return fetch({ return fetch({