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

This commit is contained in:
femyeda 2021-06-19 10:17:23 -05:00
parent fbc504f670
commit ad0b561cca

View file

@ -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
}
}