From b7c3b31e0c0431a15d93ba51e8ef1a7cfa664bdf Mon Sep 17 00:00:00 2001 From: Alex van Andel Date: Wed, 21 Jun 2023 10:56:42 +0200 Subject: [PATCH] fix: eventType-getByViewer subselect on children->users[] (#9668) --- apps/web/pages/event-types/index.tsx | 2 +- .../server/routers/viewer/eventTypes/getByViewer.handler.ts | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/apps/web/pages/event-types/index.tsx b/apps/web/pages/event-types/index.tsx index 6e0427780b..8a34c3de2a 100644 --- a/apps/web/pages/event-types/index.tsx +++ b/apps/web/pages/event-types/index.tsx @@ -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) => ({ alt: user.name || "", image: `${WEBAPP_URL}/${user.username}/avatar.png`, title: user.name || "", diff --git a/packages/trpc/server/routers/viewer/eventTypes/getByViewer.handler.ts b/packages/trpc/server/routers/viewer/eventTypes/getByViewer.handler.ts index 9e1436a7f5..baa5e14c09 100644 --- a/packages/trpc/server/routers/viewer/eventTypes/getByViewer.handler.ts +++ b/packages/trpc/server/routers/viewer/eventTypes/getByViewer.handler.ts @@ -45,7 +45,9 @@ const eventTypeSelect = Prisma.validator()({ }, children: { include: { - users: true, + users: { + select: baseUserSelect, + }, }, }, parentId: true,