summaryrefslogtreecommitdiff
path: root/src/pages/api
diff options
context:
space:
mode:
authorHATEC\SPVDEV001 <tri.susilo@altama.co.id>2024-04-25 16:34:29 +0700
committerHATEC\SPVDEV001 <tri.susilo@altama.co.id>2024-04-25 16:34:29 +0700
commit2f5d387f2235d8293e70d1807731861607357d4d (patch)
tree9d87ed7b5cc9cd441683282e21519cf41f9c65b4 /src/pages/api
parent59e4c1cf1b45497bc98cbc13c57e33e1a256a22e (diff)
fixing error search
Diffstat (limited to 'src/pages/api')
-rw-r--r--src/pages/api/shop/search.js4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/pages/api/shop/search.js b/src/pages/api/shop/search.js
index 10575d37..b6b8c795 100644
--- a/src/pages/api/shop/search.js
+++ b/src/pages/api/shop/search.js
@@ -77,14 +77,14 @@ export default async function handler(req, res) {
parameter.push(
`fq=${brand
.split(',')
- .map((manufacturer) => `manufacture_name:"${manufacturer}"`)
+ .map((manufacturer) => `manufacture_name:"${encodeURIComponent(manufacturer)}"`)
.join(' OR ')}`
);
if (category)
parameter.push(
`fq=${category
.split(',')
- .map((cat) => `category_name:"${cat}"`)
+ .map((cat) => `category_name:"${encodeURIComponent(cat)}"`)
.join(' OR ')}`
);
// if (category) parameter.push(`fq=category_name:${capitalizeFirstLetter(category.replace(/,/g, ' OR '))}`)