Attach credential id to destinationCalendar records (#3197)
This commit is contained in:
1 parent
2cbf46a323
commit
201d17264c
8 files changed
+31
-1
No files matched your search
@@ -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
|
||||
);
|
||||
|
||||
Reference in new issue
Block a user