mirror of
https://github.com/lukevella/rallly.git
synced 2025-04-28 17:56:37 +02:00
🐛 Don’t return metadata if poll is deleted (#1603)
This commit is contained in:
parent
b6fc95b03b
commit
cf9ab1b265
2 changed files with 3 additions and 2 deletions
|
@ -20,7 +20,7 @@ export default async function Layout({
|
|||
trpc.polls.comments.list.prefetch({ pollId: params.urlId }),
|
||||
]);
|
||||
|
||||
if (!poll) {
|
||||
if (!poll || poll.deleted) {
|
||||
notFound();
|
||||
}
|
||||
|
||||
|
|
|
@ -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();
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue