Fixes #701: User's page shows Team events with broken links (#761)

This commit is contained in:
Alex van Andel
2021-09-24 11:23:08 +01:00
committed by GitHub
parent 420daec147
commit 2b2fde179a

View File

@@ -92,16 +92,23 @@ export const getServerSideProps = async (context: GetServerSidePropsContext) =>
const eventTypesWithHidden = await prisma.eventType.findMany({
where: {
OR: [
AND: [
{
userId: user.id,
teamId: null,
},
{
users: {
some: {
id: user.id,
OR: [
{
userId: user.id,
},
},
{
users: {
some: {
id: user.id,
},
},
},
],
},
],
},