diff options
| author | it-fixcomart <it@fixcomart.co.id> | 2024-09-02 14:40:34 +0700 |
|---|---|---|
| committer | it-fixcomart <it@fixcomart.co.id> | 2024-09-02 14:40:34 +0700 |
| commit | 3f384749fe51a2763e7e99351f36ce70954afb7a (patch) | |
| tree | 2a14c955baa688789021ce85e37268f4cda2c17b /src/pages/api | |
| parent | bf805f7da68891250a10d85d9206607de3cbfacf (diff) | |
<iman> temp save
Diffstat (limited to 'src/pages/api')
| -rw-r--r-- | src/pages/api/shop/promo.js | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/pages/api/shop/promo.js b/src/pages/api/shop/promo.js index 4b4c09b7..353ff3df 100644 --- a/src/pages/api/shop/promo.js +++ b/src/pages/api/shop/promo.js @@ -1,4 +1,4 @@ -import { map } from '@/utils/solrMapping'; +import { productMappingSolr, promoMappingSolr } from '@/utils/solrMapping'; import axios from 'axios'; import camelcaseObjectDeep from 'camelcase-object-deep'; @@ -55,7 +55,7 @@ export default async function handler(req, res) { 'indent=true', // `facet.query=${escapeSolrQuery(q)}`, `q.op=${operation}`, - `q=${newQ}`, + `q=${q}`, // 'qf=name_s', `start=${parseInt(offset)}`, `rows=${limit}`, @@ -110,7 +110,7 @@ export default async function handler(req, res) { ); console.log("result",result) try { - result.data.response.products = map( + result.data.response.products = promoMappingSolr( result.data.response.docs, auth?.pricelist || false ); @@ -121,6 +121,7 @@ export default async function handler(req, res) { result.data.responseHeader.params.rows ); delete result.data.response.docs; + console.log("result.data",result.data) result.data = camelcaseObjectDeep(result.data); res.status(200).json(result.data); } catch (error) { |
