From 88768dffefa6f84a852c160523869912a60a381a Mon Sep 17 00:00:00 2001 From: Kipruto <43873157+kelvinkipruto@users.noreply.github.com> Date: Mon, 18 Sep 2023 14:51:10 +0300 Subject: [PATCH] Fix not found pages --- apps/codeforafrica/src/lib/data/rest/index.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/apps/codeforafrica/src/lib/data/rest/index.js b/apps/codeforafrica/src/lib/data/rest/index.js index b74fd48d6..4ee7a18b1 100644 --- a/apps/codeforafrica/src/lib/data/rest/index.js +++ b/apps/codeforafrica/src/lib/data/rest/index.js @@ -36,7 +36,12 @@ export const api = { export async function getPageStaticProps(context) { const props = await getPageProps(api, context); + if (!props) { + return { + notFound: true, + }; + } return { - props: props || {}, + props, }; }