From d74a59dddeb61849881f25ddc0058387bbd887ca Mon Sep 17 00:00:00 2001 From: Tben <52448020+BenjaminToby@users.noreply.github.com> Date: Sat, 6 Aug 2022 20:06:43 +0100 Subject: [PATCH] updates --- pages/blog/[single].jsx | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/pages/blog/[single].jsx b/pages/blog/[single].jsx index da58638..98f7ba7 100644 --- a/pages/blog/[single].jsx +++ b/pages/blog/[single].jsx @@ -35,12 +35,6 @@ export default function BlogIndex({ blogPost }) { /** ********************************************** */ // ## Javascript Variables - let reactKey = 0; - - /** ********************************************** */ - /** ********************************************** */ - /** ********************************************** */ - /** ********************************************** */ /** ********************************************** */ @@ -152,7 +146,7 @@ export async function getStaticProps({ params }) { .end(); }); - if (!postsResponse.success) { + if (!postsResponse.success || !postsResponse.payload[0]) { return { redirect: { destination: "/blog", @@ -172,6 +166,7 @@ export async function getStaticProps({ params }) { props: { blogPost: post, }, + revalidate: 1000 }; /** ********************************************** */ @@ -256,7 +251,7 @@ export async function getStaticPaths() { return { paths: paths, - fallback: true, + fallback: "blocking", } }