diff --git a/packages/features/ee/workflows/api/scheduleEmailReminders.ts b/packages/features/ee/workflows/api/scheduleEmailReminders.ts index 06aa08c447..3ce801fb0f 100644 --- a/packages/features/ee/workflows/api/scheduleEmailReminders.ts +++ b/packages/features/ee/workflows/api/scheduleEmailReminders.ts @@ -34,7 +34,11 @@ type Booking = Prisma.BookingGetPayload<{ }; }>; -function getiCalEventAsString(booking: Booking) { +function getiCalEventAsString( + booking: Pick & { + eventType: { recurringEvent?: Prisma.JsonValue; title?: string } | null; + } +) { let recurrenceRule: string | undefined = undefined; const recurringEvent = parseRecurringEvent(booking.eventType?.recurringEvent); if (recurringEvent?.count) { @@ -114,6 +118,9 @@ async function handler(req: NextApiRequest, res: NextApiResponse) { }, skip: pageNumber * pageSize, take: pageSize, + select: { + referenceId: true, + }, }); if (remindersToDelete.length === 0) { @@ -156,6 +163,10 @@ async function handler(req: NextApiRequest, res: NextApiResponse) { }, skip: pageNumber * pageSize, take: pageSize, + select: { + referenceId: true, + id: true, + }, }); if (remindersToCancel.length === 0) { @@ -203,13 +214,40 @@ async function handler(req: NextApiRequest, res: NextApiResponse) { }, skip: pageNumber * pageSize, take: pageSize, - include: { - workflowStep: true, + select: { + id: true, + scheduledDate: true, + workflowStep: { + select: { + action: true, + sendTo: true, + reminderBody: true, + emailSubject: true, + template: true, + sender: true, + includeCalendarEvent: true, + }, + }, booking: { - include: { - eventType: true, + select: { + startTime: true, + endTime: true, + location: true, + description: true, user: true, + metadata: true, + uid: true, + customInputs: true, + responses: true, attendees: true, + eventType: { + select: { + bookingFields: true, + title: true, + slug: true, + recurringEvent: true, + }, + }, }, }, },