From 9957e133a72a18535550d0ca4bd07ffe12256e7a Mon Sep 17 00:00:00 2001 From: Kipruto <43873157+kelvinkipruto@users.noreply.github.com> Date: Tue, 19 Sep 2023 13:46:40 +0300 Subject: [PATCH] Fix not found pages --- apps/codeforafrica/src/lib/data/rest/index.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/apps/codeforafrica/src/lib/data/rest/index.js b/apps/codeforafrica/src/lib/data/rest/index.js index 80c11bb13..63517ea4b 100644 --- a/apps/codeforafrica/src/lib/data/rest/index.js +++ b/apps/codeforafrica/src/lib/data/rest/index.js @@ -36,6 +36,13 @@ export const api = { export async function getPageStaticProps(context) { const props = await getPageProps(api, context); + if (!props) { + return { + props: { + title: "Page not found", + }, + }; + } return { props, };