From 9f10b502da7e1d102ddb0b16175b828834ff6f44 Mon Sep 17 00:00:00 2001 From: it-fixcomart Date: Tue, 19 Nov 2024 10:50:07 +0700 Subject: delete console log --- src/pages/api/page-content.js | 1 - src/pages/api/shop/search.js | 9 +-------- 2 files changed, 1 insertion(+), 9 deletions(-) (limited to 'src/pages/api') diff --git a/src/pages/api/page-content.js b/src/pages/api/page-content.js index 3cb8a237..a6514505 100644 --- a/src/pages/api/page-content.js +++ b/src/pages/api/page-content.js @@ -22,7 +22,6 @@ export default async function handler(req, res) { if (!cachedData) { const items = await getPageContent({ path }); - console.log('items', items); await client.set( `page-content:${path}`, JSON.stringify(items), diff --git a/src/pages/api/shop/search.js b/src/pages/api/shop/search.js index 65927bbc..63ec7ca0 100644 --- a/src/pages/api/shop/search.js +++ b/src/pages/api/shop/search.js @@ -19,12 +19,7 @@ export default async function handler(req, res) { source = '', } = req.query; - - - console.log('fq new', fq); - let { stock = '' } = req.query; - let paramOrderBy = ''; switch (orderBy) { case 'flashsale-discount-desc': @@ -93,7 +88,6 @@ export default async function handler(req, res) { 'price_tier1_v2_f:[1 TO *]', ]; - if (fq && source != 'similar' && typeof fq != 'string') { // filterQueries.push(fq); fq.push(...filterQueries); @@ -103,7 +97,7 @@ export default async function handler(req, res) { let keywords = newQ; if (source === 'similar' || checkQ.length < 3) { if (checkQ.length < 2 || checkQ[1].length < 2) { - keywords = newQ ; + keywords = newQ; } else { keywords = newQ + '*'; } @@ -170,7 +164,6 @@ export default async function handler(req, res) { parameter = parameter.concat( fq.map((val) => `fq=${encodeURIComponent(val)}`) ); - let result = await axios( process.env.SOLR_HOST + '/solr/product/select?' + parameter.join('&') ); -- cgit v1.2.3 From cbd9bc991a572a80a840a8105640a1b0f1a8bdd4 Mon Sep 17 00:00:00 2001 From: trisusilo48 Date: Wed, 20 Nov 2024 10:50:39 +0700 Subject: bugs fix filter variant price != 0 --- src/pages/api/shop/product-detail.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/pages/api') diff --git a/src/pages/api/shop/product-detail.js b/src/pages/api/shop/product-detail.js index 247f2a04..faa96028 100644 --- a/src/pages/api/shop/product-detail.js +++ b/src/pages/api/shop/product-detail.js @@ -8,7 +8,7 @@ export default async function handler(req, res) { ) let productVariants = await axios( process.env.SOLR_HOST + - `/solr/variants/select?q=template_id_i:${req.query.id}&q.op=OR&indent=true&rows=100&fq=-publish_b:false` + `/solr/variants/select?q=template_id_i:${req.query.id}&q.op=OR&indent=true&rows=100&fq=-publish_b:false AND price_tier1_v2_f:[1 TO *]` ) let auth = req.query.auth === 'false' ? JSON.parse(req.query.auth) : req.query.auth let result = productMappingSolr(productTemplate.data.response.docs, auth || false) -- cgit v1.2.3