From cf9ab1b26544eba3dba832bdfda67fffcee3edaf Mon Sep 17 00:00:00 2001 From: Luke Vella Date: Mon, 3 Mar 2025 18:20:29 +0000 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20Don=E2=80=99t=20return=20metadat?= =?UTF-8?q?a=20if=20poll=20is=20deleted=20(#1603)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/web/src/app/[locale]/invite/[urlId]/layout.tsx | 2 +- apps/web/src/app/[locale]/invite/[urlId]/page.tsx | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/apps/web/src/app/[locale]/invite/[urlId]/layout.tsx b/apps/web/src/app/[locale]/invite/[urlId]/layout.tsx index aae2796b0..2d3ca84cd 100644 --- a/apps/web/src/app/[locale]/invite/[urlId]/layout.tsx +++ b/apps/web/src/app/[locale]/invite/[urlId]/layout.tsx @@ -20,7 +20,7 @@ export default async function Layout({ trpc.polls.comments.list.prefetch({ pollId: params.urlId }), ]); - if (!poll) { + if (!poll || poll.deleted) { notFound(); } diff --git a/apps/web/src/app/[locale]/invite/[urlId]/page.tsx b/apps/web/src/app/[locale]/invite/[urlId]/page.tsx index a0aa064ed..22e77a084 100644 --- a/apps/web/src/app/[locale]/invite/[urlId]/page.tsx +++ b/apps/web/src/app/[locale]/invite/[urlId]/page.tsx @@ -52,6 +52,7 @@ export async function generateMetadata({ select: { id: true, title: true, + deleted: true, user: { select: { name: true, @@ -62,7 +63,7 @@ export async function generateMetadata({ const { t } = await getTranslation(locale); - if (!poll) { + if (!poll || poll.deleted) { notFound(); }