fix: eventType-getByViewer subselect on children->users[] (#9668)

pull/9291/head
Alex van Andel 2023-06-21 10:56:42 +02:00 committed by GitHub
parent ab6781cd72
commit b7c3b31e0c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 2 deletions

View File

@ -420,7 +420,7 @@ export const EventTypeList = ({ group, groupIndex, readOnly, types }: EventTypeL
truncateAfter={4}
items={type.children
.flatMap((ch) => ch.users)
.map((user: User) => ({
.map((user: Pick<User, "name" | "username">) => ({
alt: user.name || "",
image: `${WEBAPP_URL}/${user.username}/avatar.png`,
title: user.name || "",

View File

@ -45,7 +45,9 @@ const eventTypeSelect = Prisma.validator<Prisma.EventTypeSelect>()({
},
children: {
include: {
users: true,
users: {
select: baseUserSelect,
},
},
},
parentId: true,