parallel requests

This commit is contained in:
Tobias Koppers 2021-06-01 09:23:53 +02:00
parent c1dd44964f
commit 993525c553

View File

@ -9,8 +9,10 @@ export async function getSearchStaticProps({
locale,
}: GetStaticPropsContext) {
const config = getConfig({ locale })
const { pages } = await getAllPages({ config, preview })
const { categories, brands } = await getSiteInfo({ config, preview })
const pagesPromise = getAllPages({ config, preview })
const siteInfoPromise = getSiteInfo({ config, preview })
const { pages } = await pagesPromise
const { categories, brands } = await siteInfoPromise
return {
props: {
pages,