fix: #11397 request for reschedule did not cancel initial meeting (#11411)

pull/11494/head
Vijay 2023-09-23 04:43:17 +05:30 committed by GitHub
parent e0c87cf664
commit 0b7e3510a5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 3 deletions

View File

@ -149,7 +149,7 @@ const updateMeeting = async (
};
};
const deleteMeeting = async (credential: CredentialPayload, uid: string): Promise<unknown> => {
const deleteMeeting = async (credential: CredentialPayload | null, uid: string): Promise<unknown> => {
if (credential) {
const videoAdapter = (await getVideoAdapters([credential]))[0];
logger.debug("videoAdapter inside deleteMeeting", { credential, uid });

View File

@ -205,10 +205,15 @@ export const requestRescheduleHandler = async ({ ctx, input }: RequestReschedule
if (!bookingRef.uid) return;
if (bookingRef.type.endsWith("_calendar")) {
const calendar = await getCalendar(credentialsMap.get(bookingRef.type));
const calendar = await getCalendar(
credentials.find((cred) => cred.id === bookingRef?.credentialId) || null
);
return calendar?.deleteEvent(bookingRef.uid, builder.calendarEvent, bookingRef.externalCalendarId);
} else if (bookingRef.type.endsWith("_video")) {
return deleteMeeting(credentialsMap.get(bookingRef.type), bookingRef.uid);
return deleteMeeting(
credentials.find((cred) => cred?.id === bookingRef?.credentialId) || null,
bookingRef.uid
);
}
})
);