Merge pull request #289 from femyeda/hotfix/500-on-type-page
fix: eventType not defined on [user]/[type]pull/291/head
commit
6d7ec7fa66
|
@ -389,7 +389,12 @@ export async function getServerSideProps(context) {
|
|||
}
|
||||
});
|
||||
|
||||
if (user) {
|
||||
if (!user ) {
|
||||
return {
|
||||
notFound: true,
|
||||
}
|
||||
}
|
||||
|
||||
const eventType = await prisma.eventType.findFirst({
|
||||
where: {
|
||||
userId: user.id,
|
||||
|
@ -404,11 +409,10 @@ export async function getServerSideProps(context) {
|
|||
length: true
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
if (!user || !eventType) {
|
||||
if (!eventType) {
|
||||
return {
|
||||
notFound: true,
|
||||
notFound: true
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue