mirror of
https://github.com/lukevella/rallly.git
synced 2025-06-08 05:31:51 +02:00
🐛 Don’t return metadata if poll is deleted
This commit is contained in:
parent
b6fc95b03b
commit
a8bcde45b3
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 }),
|
trpc.polls.comments.list.prefetch({ pollId: params.urlId }),
|
||||||
]);
|
]);
|
||||||
|
|
||||||
if (!poll) {
|
if (!poll || poll.deleted) {
|
||||||
notFound();
|
notFound();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -52,6 +52,7 @@ export async function generateMetadata({
|
||||||
select: {
|
select: {
|
||||||
id: true,
|
id: true,
|
||||||
title: true,
|
title: true,
|
||||||
|
deleted: true,
|
||||||
user: {
|
user: {
|
||||||
select: {
|
select: {
|
||||||
name: true,
|
name: true,
|
||||||
|
@ -62,7 +63,7 @@ export async function generateMetadata({
|
||||||
|
|
||||||
const { t } = await getTranslation(locale);
|
const { t } = await getTranslation(locale);
|
||||||
|
|
||||||
if (!poll) {
|
if (!poll || poll.deleted) {
|
||||||
notFound();
|
notFound();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue