import productSearchApi from '@/lib/product/api/productSearchApi'; import variantSearchApi from '@/lib/product/api/variantSearchApi'; import _ from 'lodash-contrib'; const limit = 5000; export async function getServerSideProps() { const queries = { limit: 1, priceFrom: 1, fq: 'image_s:["" TO *] AND publish_b:true AND price_tier1_v2_f:[1 TO *]', // product_rating_f: '[8 TO *]', // price_tier1_v2_f: '[1 TO *]', }; const products = await variantSearchApi({ query: _.toQuery(queries) }); const { numFound } = products.response; const pageTotal = Math.ceil(numFound / limit); return { props: { pageTotal, numFound } }; } export default function GoogleMerchantPage({ pageTotal, numFound }) { const numberArray = Array.from({ length: pageTotal }, (_, index) => index); return (