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

pull/764/head
Alex van Andel 2021-09-24 11:23:08 +01:00 committed by GitHub
parent 420daec147
commit 2b2fde179a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 13 additions and 6 deletions

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,
},
},
},
],
},
],
},