Merge pull request #5 from reactioncommerce/open-commerce

Fix build failed on local package
This commit is contained in:
Chloe 2022-05-19 10:39:14 +07:00 committed by GitHub
commit a29bb6fc27
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 39 additions and 8 deletions

View File

@ -0,0 +1,17 @@
import { MutationHook } from '@vercel/commerce/utils/types'
import useSubmitCheckout, {
UseSubmitCheckout,
} from '@vercel/commerce/checkout/use-submit-checkout'
export default useSubmitCheckout as UseSubmitCheckout<typeof handler>
export const handler: MutationHook<any> = {
fetchOptions: {
query: '',
},
async fetcher({ input, options, fetch }) {},
useHook:
({ fetch }) =>
() =>
async () => ({}),
}

View File

@ -0,0 +1,17 @@
import { MutationHook } from '@vercel/commerce/utils/types'
import useUpdateItem, {
UseUpdateItem,
} from '@vercel/commerce/customer/address/use-update-item'
export default useUpdateItem as UseUpdateItem<typeof handler>
export const handler: MutationHook<any> = {
fetchOptions: {
query: '',
},
async fetcher({ input, options, fetch }) {},
useHook:
({ fetch }) =>
() =>
async () => ({}),
}

View File

@ -1,8 +1,5 @@
import type { UpdateItemHook } from '@vercel/commerce/types/customer/address'
import type {
MutationHook,
MutationHookContext,
} from '@vercel/commerce/utils/types'
import type { MutationHook } from '@vercel/commerce/utils/types'
import { useCallback } from 'react'
import useUpdateItem, {
UseUpdateItem,

View File

@ -17,7 +17,7 @@ export async function getSearchStaticProps({
pages,
categories,
brands,
navigation,
...(navigation ? { navigation } : {}),
},
revalidate: 200,
}

View File

@ -44,7 +44,7 @@ export async function getStaticProps({
}
return {
props: { pages, page, categories, navigation },
props: { pages, page, categories, ...(navigation ? { navigation } : {}) },
revalidate: 60 * 60, // Every hour
}
}

View File

@ -30,7 +30,7 @@ export async function getStaticProps({
categories,
brands,
pages,
navigation,
...(navigation ? { navigation } : {}),
},
revalidate: 60,
}

View File

@ -43,7 +43,7 @@ export async function getStaticProps({
product,
relatedProducts,
categories,
navigation,
...(navigation ? { navigation } : {}),
},
revalidate: 200,
}