Fixes #1021 - correctly replace integrations:google:meet (#1071)

pull/1072/head
Alex van Andel 2021-10-29 09:21:32 +01:00 committed by GitHub
parent 2feed85a1a
commit eefb829f75
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 14 deletions

View File

@ -82,8 +82,8 @@ export default class EventManager {
let evt = EventManager.processLocation(event);
const isDedicated = evt.location ? EventManager.isDedicatedIntegration(evt.location) : null;
let results: Array<EventResult> = [];
// First, create all calendar events. If this is a dedicated integration event, don't send a mail right here.
const results: Array<EventResult> = await this.createAllCalendarEvents(evt, isDedicated);
// If and only if event type is a dedicated meeting, create a dedicated video meeting.
if (isDedicated) {
const result = await this.createVideoEvent(evt);
@ -95,10 +95,6 @@ export default class EventManager {
await EventManager.sendAttendeeMail("new", results, evt);
}
// Now create all calendar events. If this is a dedicated integration event,
// don't send a mail right here, because it has already been sent.
results = results.concat(await this.createAllCalendarEvents(evt, isDedicated));
const referencesToCreate: Array<PartialReference> = results.map((result: EventResult) => {
let uid = "";
if (result.createdEvent) {
@ -162,9 +158,8 @@ export default class EventManager {
}
const isDedicated = evt.location ? EventManager.isDedicatedIntegration(evt.location) : null;
let results: Array<EventResult> = [];
// First, create all calendar events. If this is a dedicated integration event, don't send a mail right here.
const results: Array<EventResult> = await this.updateAllCalendarEvents(evt, booking, isDedicated);
// If and only if event type is a dedicated meeting, update the dedicated video meeting.
if (isDedicated) {
const result = await this.updateVideoEvent(evt, booking);
@ -175,11 +170,6 @@ export default class EventManager {
} else {
await EventManager.sendAttendeeMail("reschedule", results, evt);
}
// Now update all calendar events. If this is a dedicated integration event,
// don't send a mail right here, because it has already been sent.
results = results.concat(await this.updateAllCalendarEvents(evt, booking, isDedicated));
// Now we can delete the old booking and its references.
const bookingReferenceDeletes = prisma.bookingReference.deleteMany({
where: {