diff options
| author | IT Fixcomart <it@fixcomart.co.id> | 2023-11-21 06:10:46 +0000 |
|---|---|---|
| committer | IT Fixcomart <it@fixcomart.co.id> | 2023-11-21 06:10:46 +0000 |
| commit | d795f24a14a9d14394c620c53711297be7775b01 (patch) | |
| tree | a0fed061231c1d41ab8302de9fb9f8cbe1e8987d /src/pages/api | |
| parent | 0fc062268c71d53f8777c358b31e2a540d60d404 (diff) | |
| parent | 87a004c0fcf256e1e92653767a630c01ad21ad5a (diff) | |
Merged in CR/UI (pull request #117)
CR/UI
Diffstat (limited to 'src/pages/api')
| -rw-r--r-- | src/pages/api/shop/brands.js | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/pages/api/shop/brands.js b/src/pages/api/shop/brands.js index e93fe2c9..dbbfcfe3 100644 --- a/src/pages/api/shop/brands.js +++ b/src/pages/api/shop/brands.js @@ -12,6 +12,11 @@ export default async function handler(req, res) { case 'level_s': params = 'level_s:prioritas' break + case 'search': + params = `name_s:${req?.query?.q.toLowerCase()}` + sort = '' + rows = 1 + break; default: params = `name_s:${req.query.params}` } @@ -20,7 +25,6 @@ export default async function handler(req, res) { process.env.SOLR_HOST + `/solr/brands/select?q=${params}&q.op=OR&indent=true&rows=${rows}&${sort}` ) - let dataBrands = responseMap(brands.data.response.docs) res.status(200).json(dataBrands) |
