Fix showing seat attendees in emails (#8033)

* Pass seats info to location change

* Fix cloning emails

* Add cloning of event in AttendeeScheduledEmail class
This commit is contained in:
Joe Au-Yeung authored and GitHub committed 2023-03-30 19:45:48 -04:00
1 parent 762810684e
commit ae5425f908
5 files changed
+27 -10

No files matched your search

@@ -67,6 +67,7 @@ async function getBookingToDelete(id: number | undefined, uid: string | undefine
currency: true,
length: true,
seatsPerTimeSlot: true,
seatsShowAttendees: true,
hosts: {
select: {
user: true,
@@ -190,6 +191,8 @@ async function handler(req: CustomRequest) {
destinationCalendar: bookingToDelete?.destinationCalendar || bookingToDelete?.user.destinationCalendar,
cancellationReason: cancellationReason,
...(teamMembers && { team: { name: "", members: teamMembers } }),
seatsPerTimeSlot: bookingToDelete.eventType?.seatsPerTimeSlot,
seatsShowAttendees: bookingToDelete.eventType?.seatsShowAttendees,
};
// If it's just an attendee of a booking then just remove them from that booking
@@ -1010,6 +1010,16 @@ async function handler(
throw new HttpError({ statusCode: 401 });
}
// Moving forward in this block is the owner making changes to the booking. All attendees should be affected
evt.attendees = originalRescheduledBooking.attendees.map((attendee) => {
return {
name: attendee.name,
email: attendee.email,
timeZone: attendee.timeZone,
language: { translate: tAttendees, locale: attendee.locale ?? "en" },
};
});
// If owner reschedules the event we want to update the entire booking
// Also if owner is rescheduling there should be no bookingSeat