4
0
forked from crowetic/commerce

convert category to number before checking for int (#422)

This commit is contained in:
MitchStarkTekton 2021-07-28 20:30:55 -04:00 committed by GitHub
parent 50c4f558db
commit 177914186e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -22,7 +22,7 @@ export const handler: SWRHook<SearchProductsHook> = {
const url = new URL(options.url!, 'http://a')
if (search) url.searchParams.set('search', search)
if (Number.isInteger(categoryId))
if (Number.isInteger(Number(categoryId)))
url.searchParams.set('categoryId', String(categoryId))
if (Number.isInteger(brandId))
url.searchParams.set('brandId', String(brandId))