From bf6dd665f0df561ec63c64337d8ea765d6e77427 Mon Sep 17 00:00:00 2001 From: Carina Wollendorfer <30310907+CarinaWolli@users.noreply.github.com> Date: Tue, 24 Oct 2023 11:27:30 -0400 Subject: [PATCH] fix: response size scheduleEmailReminder (#12057) Co-authored-by: CarinaWolli --- .../ee/workflows/api/scheduleEmailReminders.ts | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/packages/features/ee/workflows/api/scheduleEmailReminders.ts b/packages/features/ee/workflows/api/scheduleEmailReminders.ts index 3ce801fb0f..5755d7149e 100644 --- a/packages/features/ee/workflows/api/scheduleEmailReminders.ts +++ b/packages/features/ee/workflows/api/scheduleEmailReminders.ts @@ -14,6 +14,7 @@ import { parseRecurringEvent } from "@calcom/lib"; import { defaultHandler } from "@calcom/lib/server"; import { getTimeFormatStringFromUserTimeFormat } from "@calcom/lib/timeFormat"; import prisma from "@calcom/prisma"; +import type { User } from "@calcom/prisma/client"; import { WorkflowActions, WorkflowMethods, WorkflowTemplates } from "@calcom/prisma/enums"; import { bookingMetadataSchema } from "@calcom/prisma/zod-utils"; @@ -29,14 +30,14 @@ sgMail.setApiKey(sendgridAPIKey); type Booking = Prisma.BookingGetPayload<{ include: { eventType: true; - user: true; attendees: true; }; }>; function getiCalEventAsString( - booking: Pick & { + booking: Pick & { eventType: { recurringEvent?: Prisma.JsonValue; title?: string } | null; + user: Partial | null; } ) { let recurrenceRule: string | undefined = undefined; @@ -234,7 +235,17 @@ async function handler(req: NextApiRequest, res: NextApiResponse) { endTime: true, location: true, description: true, - user: true, + user: { + select: { + email: true, + name: true, + timeZone: true, + locale: true, + username: true, + timeFormat: true, + hideBranding: true, + }, + }, metadata: true, uid: true, customInputs: true,