mirror of
https://github.com/vercel/commerce.git
synced 2025-05-18 23:46:58 +00:00
26 lines
497 B
TypeScript
26 lines
497 B
TypeScript
import commerce from '@lib/api/commerce'
|
|
|
|
const getCustomInitialProps = async ({ agility, channelName, languageCode }:any) => {
|
|
|
|
//TODO: pass the locale and preview mode as props...
|
|
|
|
const locale = "en-US"
|
|
const preview = false
|
|
const config = { locale, locales: [locale] }
|
|
|
|
const siteInfoPromise = commerce.getSiteInfo({ config, preview })
|
|
|
|
const { categories, brands } = await siteInfoPromise
|
|
return {
|
|
categories,
|
|
brands,
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
export default {
|
|
getCustomInitialProps
|
|
}
|