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