Skip to content

Scheduling infrastructure for absolutely everyone.

Add uid and event responses to tasker calendar event (#18930)

Joe Au-Yeung7d4abea9b483
diff --git a/packages/features/tasker/tasks/crm/lib/buildCalendarEvent.ts b/packages/features/tasker/tasks/crm/lib/buildCalendarEvent.ts
index d1ea41f6cc6..7c360cb4cac 100644
--- a/packages/features/tasker/tasks/crm/lib/buildCalendarEvent.ts
+++ b/packages/features/tasker/tasks/crm/lib/buildCalendarEvent.ts
@@ -1,3 +1,4 @@
+import { getCalEventResponses } from "@calcom/features/bookings/lib/getCalEventResponses";
import { addVideoCallDataToEvent } from "@calcom/features/bookings/lib/handleNewBooking/addVideoCallDataToEvent";
import { getTranslation } from "@calcom/lib/server";
import prisma from "@calcom/prisma";
@@ -22,6 +23,7 @@ const buildCalendarEvent: (bookingUid: string) => Promise<CalendarEvent> = async
eventType: {
select: {
slug: true,
+ bookingFields: true,
},
},
attendees: {
@@ -67,6 +69,7 @@ const buildCalendarEvent: (bookingUid: string) => Promise<CalendarEvent> = async
const attendeeList = await Promise.all(attendeePromises);
let calendarEvent: CalendarEvent = {
+ uid: bookingUid,
type: booking.eventType.slug,
title: booking.title,
startTime: booking.startTime.toISOString(),
@@ -80,6 +83,10 @@ const buildCalendarEvent: (bookingUid: string) => Promise<CalendarEvent> = async
},
attendees: attendeeList,
location: booking.location,
+ ...getCalEventResponses({
+ bookingFields: booking?.eventType?.bookingFields ?? null,
+ booking,
+ }),
};
calendarEvent = addVideoCallDataToEvent(booking.references, calendarEvent);