🐛 Don’t return metadata if poll is deleted (#1603)

This commit is contained in:
Luke Vella 2025-03-03 18:20:29 +00:00 committed by GitHub
parent b6fc95b03b
commit cf9ab1b265
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 3 additions and 2 deletions

View file

@ -20,7 +20,7 @@ export default async function Layout({
trpc.polls.comments.list.prefetch({ pollId: params.urlId }),
]);
if (!poll) {
if (!poll || poll.deleted) {
notFound();
}

View file

@ -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();
}