Add start and end time of rescheduled booking to webhook payload (#6297)

* add start and end time of rescheduled booking

* fix type error

Co-authored-by: CarinaWolli <wollencarina@gmail.com>
This commit is contained in:
Carina Wollendorfer
2023-01-06 13:37:06 -07:00
committed by GitHub
co-authored by CarinaWolli
parent a0709fac88
commit a28ac3634d
2 changed files with 9 additions and 1 deletions
@@ -1009,6 +1009,12 @@ async function handler(req: NextApiRequest & { userId?: number | undefined }) {
...eventTypeInfo,
bookingId,
rescheduleUid,
rescheduleStartTime: originalRescheduledBooking?.startTime
? dayjs(originalRescheduledBooking?.startTime).utc().format()
: undefined,
rescheduleEndTime: originalRescheduledBooking?.endTime
? dayjs(originalRescheduledBooking?.endTime).utc().format()
: undefined,
metadata: { ...metadata, ...reqBody.metadata },
eventTypeId,
status: "ACCEPTED",
@@ -82,10 +82,12 @@ const sendPayload = async (
data: CalendarEvent &
EventTypeInfo & {
metadata?: { [key: string]: string };
rescheduleUid?: string;
bookingId?: number;
status?: string;
smsReminderNumber?: string;
rescheduleUid?: string;
rescheduleStartTime?: string;
rescheduleEndTime?: string;
}
) => {
const { appId, payloadTemplate: template } = webhook;