Skip to content

Commit

Permalink
cms-datocms SerializableError fixes (vercel#10986)
Browse files Browse the repository at this point in the history
  • Loading branch information
followbl authored and ScriptedAlchemy committed Mar 17, 2020
1 parent a3ed25f commit f869cb1
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion examples/cms-datocms/pages/index.js
Expand Up @@ -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 },
}
Expand Down
2 changes: 1 addition & 1 deletion examples/cms-datocms/pages/posts/[slug].js
Expand Up @@ -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 || '')

Expand Down

0 comments on commit f869cb1

Please sign in to comment.