Skip to content

Scheduling infrastructure for absolutely everyone.

fix: eventType not defined on [user]/[type]

femyedaad0b561cca21
diff --git a/pages/[user]/[type].tsx b/pages/[user]/[type].tsx
index 43edc841f3d..aa57bd48067 100644
--- a/pages/[user]/[type].tsx
+++ b/pages/[user]/[type].tsx
@@ -389,26 +389,30 @@ 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 ) {
+ return {
+ notFound: true,
+ }
}
- if (!user || !eventType) {
+ 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,
+ notFound: true
}
}