diff options
| author | it-fixcomart <it@fixcomart.co.id> | 2024-09-02 16:43:25 +0700 |
|---|---|---|
| committer | it-fixcomart <it@fixcomart.co.id> | 2024-09-02 16:43:25 +0700 |
| commit | b30e6a53d660f9ccbc0ded640c2a1dc5df673ff2 (patch) | |
| tree | ae840e06b29d9ccdeb88c31b17d1962ebd9f5539 /src/pages | |
| parent | 3f384749fe51a2763e7e99351f36ce70954afb7a (diff) | |
<iman> update fetch data
Diffstat (limited to 'src/pages')
| -rw-r--r-- | src/pages/api/shop/promo.js | 6 | ||||
| -rw-r--r-- | src/pages/shop/promo/[slug].jsx | 6 |
2 files changed, 6 insertions, 6 deletions
diff --git a/src/pages/api/shop/promo.js b/src/pages/api/shop/promo.js index 353ff3df..e6867e89 100644 --- a/src/pages/api/shop/promo.js +++ b/src/pages/api/shop/promo.js @@ -108,12 +108,12 @@ export default async function handler(req, res) { let result = await axios( process.env.SOLR_HOST + '/solr/promotion_program_lines/select?' + parameter.join('&') ); - console.log("result",result) try { result.data.response.products = promoMappingSolr( - result.data.response.docs, - auth?.pricelist || false + result.data.response.docs ); + console.log("result.data.response.products",result.data.response.products) + result.data.responseHeader.params.start = parseInt( result.data.responseHeader.params.start ); diff --git a/src/pages/shop/promo/[slug].jsx b/src/pages/shop/promo/[slug].jsx index 544286f9..ce73ebd1 100644 --- a/src/pages/shop/promo/[slug].jsx +++ b/src/pages/shop/promo/[slug].jsx @@ -24,7 +24,7 @@ import whatsappUrl from '../../../core/utils/whatsappUrl.js'; import { cons, toQuery } from 'lodash-contrib'; import _ from 'lodash'; import useActive from '../../../core/hooks/useActive.js'; -import useProductSearch from '../../../lib/product/hooks/useProductSearch.js'; +import useProductSearch from '../../../lib/promo/hooks/usePromotionSearch.js'; const BasicLayout = dynamic(() => import('../../../core/components/layouts/BasicLayout.jsx')) @@ -45,7 +45,7 @@ export default function PromoDetail() { const popup = useActive(); const prefixUrl = `/shop/promo/${slug}` const [queryFinal, setQueryFinal] = useState({}); - const [limit, setLimit] = useState<number>(30); + const [limit, setLimit] = useState(30); const [q, setQ] = useState('*'); const [finalQuery, setFinalQuery] = useState({fq: `type_value_s:${slug}`}); const [products, setProducts] = useState(null); @@ -365,7 +365,7 @@ export default function PromoDetail() { ) : promoData && promoItems.length >= 1 ? ( <> <div className='grid grid-cols-1 gap-x-1 gap-y-1'> - {visiblePromotions?.map((promotion) => ( + {products?.map((promotion) => ( <div key={promotion.id} className="min-w-36 max-w-[400px] mb-[20px] sm:w-full md:w-1/2 lg:w-1/3 xl:w-1/4 "> <ProductPromoCard promotion={promotion}/> </div> |
