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. * Find the data method for a module by module reference name.
* @param moduleName * @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()) const obj = allModules.find((m: { name: string }) => m.name.toLowerCase() === moduleName.toLowerCase())
if (!obj) return null if (!obj) return null
return obj.init return obj.init

View File

@ -16,7 +16,7 @@ import { defaultPageProps } from '@lib/defaults'
import AgilityPage from "components/agility-global/AgilityPage" import AgilityPage from "components/agility-global/AgilityPage"
import { getConfig } from '@framework/api' import { getConfig } from '@framework/api'
import getProduct from '@framework/api/operations/get-product' 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' import getAllProductPaths from '@framework/api/operations/get-all-product-paths'
@ -81,8 +81,10 @@ export async function getStaticProps({ preview, params, locale, locales, default
return { return {
props: { props: {
error: `Params: ${params}, Error: ${err}, Stack: ${st}`, error: `Params: ${params}, Error: ${err}, Stack: ${st}`,
revalidate: 60000 header: null,
} agilityProps: null
},
revalidate: 60000
} }
} }
} }

View File

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