mirror of
https://github.com/vercel/commerce.git
synced 2025-07-26 19:51:23 +00:00
update to agility/next
This commit is contained in:
@@ -5,7 +5,7 @@ import rangeMap from '@lib/range-map'
|
||||
|
||||
const nonNullable = (v: any) => v
|
||||
|
||||
const BestsellingProductsInit = async function ({ item, agility, languageCode, channelName, pageInSitemap, dynamicPageItem }: any) {
|
||||
const getCustomInitialProps = async function ({ }):Promise<{bestSelling:any}> {
|
||||
//TODO: pass the locale and preview mode as props...
|
||||
|
||||
|
||||
@@ -52,4 +52,4 @@ const BestsellingProductsInit = async function ({ item, agility, languageCode, c
|
||||
|
||||
}
|
||||
|
||||
export default BestsellingProductsInit
|
||||
export default {getCustomInitialProps}
|
@@ -7,7 +7,7 @@ import rangeMap from '@lib/range-map'
|
||||
|
||||
const nonNullable = (v: any) => v
|
||||
|
||||
const FeaturedProductsInit = async function ({ item, agility, languageCode, channelName, pageInSitemap, dynamicPageItem }: any) {
|
||||
const getCustomInitialProps = async function ({ item, agility, languageCode, channelName, pageInSitemap, dynamicPageItem }: any) {
|
||||
//TODO: pass the locale and preview mode as props...
|
||||
|
||||
|
||||
@@ -31,4 +31,4 @@ const FeaturedProductsInit = async function ({ item, agility, languageCode, chan
|
||||
|
||||
}
|
||||
|
||||
export default FeaturedProductsInit
|
||||
export default { getCustomInitialProps }
|
@@ -8,7 +8,7 @@ import rangeMap from '@lib/range-map'
|
||||
|
||||
const nonNullable = (v: any) => v
|
||||
|
||||
const HomeAllProductsGridData = async function ({ item, agility, languageCode, channelName, pageInSitemap, dynamicPageItem }: any) {
|
||||
const getCustomInitialProps = async function ({ item, agility, languageCode, channelName, pageInSitemap, dynamicPageItem }: any) {
|
||||
//TODO: pass the locale and preview mode as props...
|
||||
|
||||
const locale = "en-US"
|
||||
@@ -35,4 +35,4 @@ const HomeAllProductsGridData = async function ({ item, agility, languageCode, c
|
||||
|
||||
}
|
||||
|
||||
export default HomeAllProductsGridData
|
||||
export default { getCustomInitialProps }
|
@@ -1,7 +1,8 @@
|
||||
import { getConfig } from '@framework/api'
|
||||
import getSiteInfo from '@framework/api/operations/get-site-info'
|
||||
|
||||
const ProductSearchData = async function ({ item, agility, languageCode, channelName, pageInSitemap, dynamicPageItem }: any) {
|
||||
const getCustomInitialProps = async ({ agility, channelName, languageCode }:any) => {
|
||||
|
||||
//TODO: pass the locale and preview mode as props...
|
||||
|
||||
const locale = "en-US"
|
||||
@@ -18,4 +19,6 @@ const ProductSearchData = async function ({ item, agility, languageCode, channel
|
||||
|
||||
}
|
||||
|
||||
export default ProductSearchData
|
||||
export default {
|
||||
getCustomInitialProps
|
||||
}
|
||||
|
@@ -14,10 +14,8 @@ const allModules:any =[
|
||||
* Find the data method for a module by module reference name.
|
||||
* @param moduleName
|
||||
*/
|
||||
const getInitMethod = (moduleName:string):any => {
|
||||
export const getModuleData = (moduleName:string):any => {
|
||||
const obj = allModules.find((m: { name: string }) => m.name.toLowerCase() === moduleName.toLowerCase())
|
||||
if (!obj) return null
|
||||
return obj.init
|
||||
}
|
||||
|
||||
export default getInitMethod
|
||||
|
Reference in New Issue
Block a user