4
0
forked from crowetic/commerce

@hotfix/fixing brand id in use-search (#174)

to set searchParam brand, should check brandId and not categoryId

Co-authored-by: mohux <m.alolabi@uxbert.com>
This commit is contained in:
mohammadou1 2021-01-22 19:59:25 +03:00 committed by GitHub
parent 742ac5786e
commit 027c4aca70
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

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