diff options
| author | trisusilo <tri.susilo@altama.co.id> | 2023-10-30 02:32:42 +0000 |
|---|---|---|
| committer | trisusilo <tri.susilo@altama.co.id> | 2023-10-30 02:32:42 +0000 |
| commit | 3196c41e81bce2f012e245e44beb689dcd1fc853 (patch) | |
| tree | 25f9169a48fabcdcabb4da2621f1196b840241a3 /src/pages/api/shop/search.js | |
| parent | e8c414325a1e32474e740cc6e7dca8396affc5e3 (diff) | |
| parent | 0a1413aec32fddc433a34bf7d03d8681dedc266d (diff) | |
Merged in CR/UI (pull request #111)
CR/UI
Diffstat (limited to 'src/pages/api/shop/search.js')
| -rw-r--r-- | src/pages/api/shop/search.js | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/pages/api/shop/search.js b/src/pages/api/shop/search.js index 883bb8df..576d028a 100644 --- a/src/pages/api/shop/search.js +++ b/src/pages/api/shop/search.js @@ -66,8 +66,9 @@ export default async function handler(req, res) { ) } - if (brand) parameter.push(`fq=manufacture_name:${brand.replace(/,/g, ' OR ')}`) - if (category) parameter.push(`fq=category_name:${category.replace(/,/g, ' OR ')}`) + if (brand) parameter.push(`fq=${brand.split(',').map(manufacturer => `manufacture_name:"${manufacturer}"`).join(" OR ")}`) + if (category) parameter.push(`fq=${category.split(',').map(cat => `category_name:"${cat}"`).join(' OR ')}`) + // if (category) parameter.push(`fq=category_name:${capitalizeFirstLetter(category.replace(/,/g, ' OR '))}`) if (stock) parameter.push(`fq=stock_total_f:{1 TO *}`) // Single fq in url params |
