diff options
| author | HATEC\SPVDEV001 <tri.susilo@altama.co.id> | 2023-10-10 17:09:23 +0700 |
|---|---|---|
| committer | HATEC\SPVDEV001 <tri.susilo@altama.co.id> | 2023-10-10 17:09:23 +0700 |
| commit | 9836f109c38d7f02c587329795e80e15ff33aafa (patch) | |
| tree | c87750e00c8ff85af190a287124c2aba284f6922 /src/pages | |
| parent | 3c4e65912b63c7abdd51747804283dadb09082b3 (diff) | |
add qty di nenu brang , filter ready stock, filter haga fix di page search
Diffstat (limited to 'src/pages')
| -rw-r--r-- | src/pages/api/shop/search.js | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/pages/api/shop/search.js b/src/pages/api/shop/search.js index b5161365..0c79831b 100644 --- a/src/pages/api/shop/search.js +++ b/src/pages/api/shop/search.js @@ -13,7 +13,8 @@ export default async function handler(req, res) { orderBy = '', operation = 'AND', fq = '', - limit = 30 + limit = 30, + stock = '' } = req.query let paramOrderBy = '' @@ -62,8 +63,9 @@ export default async function handler(req, res) { ) } - if (brand) parameter.push(`fq=manufacture_name:${brand}`) + if (brand) parameter.push(`fq=manufacture_name:${brand.replace(/,/g, ' OR ')}`) if (category) parameter.push(`fq=category_name:${category}`) + if (stock) parameter.push(`fq=stock_total_f:{1 TO *}`) // Single fq in url params if (typeof fq === 'string') parameter.push(`fq=${fq}`) |
