Try to list calendars, if not continue (#10720)

Co-authored-by: Omar López <zomars@me.com>
pull/10728/head
Joe Au-Yeung 2023-08-11 17:19:26 -04:00 committed by GitHub
parent ceb18167cf
commit 8356cb7d34
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 16 additions and 12 deletions

View File

@ -304,6 +304,7 @@ export const deleteCredentialHandler = async ({ ctx, input }: DeleteCredentialOp
// If it's a calendar remove it from the SelectedCalendars
if (credential.app?.categories.includes(AppCategories.calendar)) {
try {
const calendar = await getCalendar(credential);
const calendars = await calendar?.listCalendars();
@ -321,6 +322,9 @@ export const deleteCredentialHandler = async ({ ctx, input }: DeleteCredentialOp
});
});
}
} catch {
console.log(`Error deleting selected calendars for user ${user.id} and calendar ${credential.appId}`);
}
}
// if zapier get disconnected, delete zapier apiKey, delete zapier webhooks and cancel all scheduled jobs from zapier