commerce/lib/module-data/ProductSearchData.ts
2021-06-22 17:12:31 -04:00

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
}