Attach credential id to destinationCalendar records (#3197)

This commit is contained in:
Joe Au-Yeung authored and GitHub committed 2022-07-01 21:55:27 +01:00
1 parent 2cbf46a323
commit 201d17264c
8 files changed
+31 -1

No files matched your search

+12
View File
@@ -282,6 +282,18 @@ export default class EventManager {
/** Can I use destinationCalendar here? */
/* How can I link a DC to a cred? */
if (event.destinationCalendar) {
if (event.destinationCalendar.credentialId) {
const credential = await prisma.credential.findFirst({
where: {
id: event.destinationCalendar.credentialId,
},
});
if (credential) {
return [await createEvent(credential, event)];
}
}
const destinationCalendarCredentials = this.calendarCredentials.filter(
(c) => c.type === event.destinationCalendar?.integration
);