mirror of
https://github.com/vercel/commerce.git
synced 2025-07-23 04:36:49 +00:00
updates
This commit is contained in:
25
lib/module-data/ProductSearchData.ts
Normal file
25
lib/module-data/ProductSearchData.ts
Normal file
@@ -0,0 +1,25 @@
|
||||
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 pagesPromise = commerce.getAllPages({ config, preview })
|
||||
const siteInfoPromise = commerce.getSiteInfo({ config, preview })
|
||||
|
||||
const { categories, brands } = await siteInfoPromise
|
||||
return {
|
||||
categories,
|
||||
brands,
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
export default {
|
||||
getCustomInitialProps
|
||||
}
|
Reference in New Issue
Block a user