early return updateCalendarEvent
parent
8f3f17b299
commit
5a9f20b71b
|
@ -437,14 +437,14 @@ export default class EventManager {
|
||||||
private async updateAllCalendarEvents(
|
private async updateAllCalendarEvents(
|
||||||
event: CalendarEvent,
|
event: CalendarEvent,
|
||||||
booking: PartialBooking
|
booking: PartialBooking
|
||||||
): Promise<Array<EventResult<NewCalendarEventType>>> {
|
): Promise<Array<EventResult<NewCalendarEventType>> | []> {
|
||||||
let calendarReference: PartialReference | undefined = undefined,
|
let calendarReference: PartialReference | undefined = undefined,
|
||||||
credential;
|
credential;
|
||||||
try {
|
try {
|
||||||
// Bookings should only have one calendar reference
|
// Bookings should only have one calendar reference
|
||||||
calendarReference = booking.references.filter((reference) => reference.type.includes("_calendar"))[0];
|
calendarReference = booking.references.filter((reference) => reference.type.includes("_calendar"))[0];
|
||||||
if (!calendarReference) {
|
if (!calendarReference) {
|
||||||
throw new Error("bookingRef");
|
return [];
|
||||||
}
|
}
|
||||||
const { uid: bookingRefUid, externalCalendarId: bookingExternalCalendarId } = calendarReference;
|
const { uid: bookingRefUid, externalCalendarId: bookingExternalCalendarId } = calendarReference;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue