diff --git a/pages/[user]/[type].tsx b/pages/[user]/[type].tsx index 43edc841..aa57bd48 100644 --- a/pages/[user]/[type].tsx +++ b/pages/[user]/[type].tsx @@ -389,29 +389,33 @@ export async function getServerSideProps(context) { } }); - if (user) { - const eventType = await prisma.eventType.findFirst({ - where: { - userId: user.id, - slug: { - equals: context.query.type, - }, - }, - select: { - id: true, - title: true, - description: true, - length: true - } - }); - } - - if (!user || !eventType) { + if (!user ) { return { notFound: true, } } + const eventType = await prisma.eventType.findFirst({ + where: { + userId: user.id, + slug: { + equals: context.query.type, + }, + }, + select: { + id: true, + title: true, + description: true, + length: true + } + }); + + if (!eventType) { + return { + notFound: true + } + } + return { props: { user,