Skip to content

Commit

Permalink
add default null for cms-datocms post fetch
Browse files Browse the repository at this point in the history
  • Loading branch information
followbl committed Mar 11, 2020
1 parent 9d9f7a5 commit 69a0a79
Showing 1 changed file with 1 addition and 1 deletion.
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 69a0a79

Please sign in to comment.