Well, you can have 0 attendees in a booking (#7494)

This commit is contained in:
Hariom Balhara
2023-03-03 09:35:58 -07:00
committed by GitHub
parent 26ea249481
commit d8387835a8
+3 -2
View File
@@ -30,8 +30,9 @@ function getResponsesFromOldBooking(
return acc;
}, {});
return {
name: rawBooking.attendees[0].name,
email: rawBooking.attendees[0].email,
// It is possible to have no attendees in a booking when the booking is cancelled.
name: rawBooking.attendees[0]?.name || "Nameless",
email: rawBooking.attendees[0]?.email || "",
guests: rawBooking.attendees.slice(1).map((attendee) => {
return attendee.email;
}),