cms-datocms SerializableError fixes (#10986)
This commit is contained in:
parent
a86184eb89
commit
3b5029fb92
2 changed files with 2 additions and 2 deletions
|
@ -36,7 +36,7 @@ export default function Index({ allPosts }) {
|
|||
}
|
||||
|
||||
export async function getStaticProps({ preview }) {
|
||||
const allPosts = await getAllPostsForHome(preview)
|
||||
const allPosts = await getAllPostsForHome(preview) || []
|
||||
return {
|
||||
props: { allPosts },
|
||||
}
|
||||
|
|
|
@ -50,7 +50,7 @@ export default function Post({ post, morePosts, preview }) {
|
|||
)
|
||||
}
|
||||
|
||||
export async function getStaticProps({ params, preview }) {
|
||||
export async function getStaticProps({ params, preview = null }) {
|
||||
const data = await getPostAndMorePosts(params.slug, preview)
|
||||
const content = await markdownToHtml(data?.post?.content || '')
|
||||
|
||||
|
|
Loading…
Reference in a new issue