From 3bdd7de29a2d453932e1d987149745b3b59cb884 Mon Sep 17 00:00:00 2001 From: Redm4x <2829180+Redm4x@users.noreply.github.com> Date: Tue, 27 Aug 2024 15:47:29 -0400 Subject: [PATCH] fix: return 404 when template is not found --- apps/deploy-web/src/pages/templates/[templateId]/index.tsx | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/apps/deploy-web/src/pages/templates/[templateId]/index.tsx b/apps/deploy-web/src/pages/templates/[templateId]/index.tsx index 8d5f0d5b9..1dc6eddf2 100644 --- a/apps/deploy-web/src/pages/templates/[templateId]/index.tsx +++ b/apps/deploy-web/src/pages/templates/[templateId]/index.tsx @@ -24,6 +24,12 @@ export async function getServerSideProps({ params }) { const templates = categories.flatMap(x => x.templates); const template = templates.find(x => x.id === params?.templateId); + if (!template) { + return { + notFound: true + }; + } + return { props: { templateId: params?.templateId,