Add Google cal extneral calendar id to booking reference (#2671)

* Set google cal event id to use our uid

* Save calendar external id to bookingRef

* Pass external calendar ids to update and delete

* Create migration

* Fix type errors

* Fix prisma url

Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
Co-authored-by: Omar López <[email protected]>
This commit is contained in:
authored and GitHub committed 2022-05-16 14:20:09 -06:00
1 parent 4e97d3ed72
commit ad126efee8
8 files changed
+30 -14

No files matched your search

+7 -1
View File
@@ -146,6 +146,7 @@ export default class EventManager {
meetingId: result.createdEvent?.id.toString(),
meetingPassword: result.createdEvent?.password,
meetingUrl: result.createdEvent?.url,
externalCalendarId: evt.destinationCalendar?.externalId,
};
});
@@ -188,6 +189,7 @@ export default class EventManager {
meetingId: true,
meetingPassword: true,
meetingUrl: true,
externalCalendarId: true,
},
},
destinationCalendar: true,
@@ -354,7 +356,11 @@ export default class EventManager {
? booking.references.filter((ref) => ref.type === credential.type && !!ref.uid)[0]?.uid
: null;
return updateEvent(credential, event, bookingRefUid);
const bookingExternalCalendarId = booking.references
? booking.references.filter((ref) => ref.type === credential.type)[0].externalCalendarId
: null;
return updateEvent(credential, event, bookingRefUid, bookingExternalCalendarId!);
});
}