Fix rescheduling updating calendars & duplicate bookings (#7851)
* Fix rescheduling * Fix tests * Clean up * Update packages/core/EventManager.ts Co-authored-by: Syed Ali Shahbaz <52925846+alishaz-polymath@users.noreply.github.com> * Commit fix --------- Co-authored-by: Syed Ali Shahbaz <52925846+alishaz-polymath@users.noreply.github.com> Co-authored-by: Peer Richelsen <peeroke@gmail.com>pull/7821/head^2
parent
1512551903
commit
49ee5d300b
|
@ -439,12 +439,9 @@ export default class EventManager {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
if (newBooking) {
|
calendarReference = newBooking?.references.length
|
||||||
calendarReference = newBooking.references.find((reference) => reference.type.includes("_calendar"));
|
? newBooking.references.find((reference) => reference.type.includes("_calendar"))
|
||||||
} else {
|
: booking.references.find((reference) => reference.type.includes("_calendar"));
|
||||||
// Bookings should only have one calendar reference
|
|
||||||
calendarReference = booking.references.find((reference) => reference.type.includes("_calendar"));
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!calendarReference) {
|
if (!calendarReference) {
|
||||||
return [];
|
return [];
|
||||||
|
|
|
@ -1655,7 +1655,7 @@ async function handler(
|
||||||
|
|
||||||
// Use EventManager to conditionally use all needed integrations.
|
// Use EventManager to conditionally use all needed integrations.
|
||||||
|
|
||||||
const updateManager = await eventManager.reschedule(evt, originalRescheduledBooking.uid, booking?.id);
|
const updateManager = await eventManager.reschedule(evt, originalRescheduledBooking.uid);
|
||||||
// This gets overridden when updating the event - to check if notes have been hidden or not. We just reset this back
|
// This gets overridden when updating the event - to check if notes have been hidden or not. We just reset this back
|
||||||
// to the default description when we are sending the emails.
|
// to the default description when we are sending the emails.
|
||||||
evt.description = eventType.description;
|
evt.description = eventType.description;
|
||||||
|
|
Loading…
Reference in New Issue