This commit is contained in:
Joel Varty 2021-06-17 15:25:22 -04:00
parent e836a5950f
commit b2d078a37f
3 changed files with 8 additions and 4 deletions

View File

@ -14,7 +14,7 @@ const allModules:any =[
* Find the data method for a module by module reference name.
* @param moduleName
*/
export const getModuleData = (moduleName:string):any => {
export default (moduleName:string):any => {
const obj = allModules.find((m: { name: string }) => m.name.toLowerCase() === moduleName.toLowerCase())
if (!obj) return null
return obj.init

View File

@ -16,7 +16,7 @@ import { defaultPageProps } from '@lib/defaults'
import AgilityPage from "components/agility-global/AgilityPage"
import { getConfig } from '@framework/api'
import getProduct from '@framework/api/operations/get-product'
import { getModuleData } from "framework/module-data"
import getModuleData from "framework/module-data"
import getAllProductPaths from '@framework/api/operations/get-all-product-paths'
@ -81,11 +81,13 @@ export async function getStaticProps({ preview, params, locale, locales, default
return {
props: {
error: `Params: ${params}, Error: ${err}, Stack: ${st}`,
header: null,
agilityProps: null
},
revalidate: 60000
}
}
}
}
export async function getStaticPaths({ defaultLocale, locales }: GetStaticPathsContext) {

View File

@ -1,3 +1,5 @@
export default {}
// import { NextApiRequest, NextApiResponse } from "next"
// import getProducts from "../../shopify-api/get-products"