Fix no video reference on google-meet (#8849)
parent
4374da08e2
commit
b44e5a7aae
|
@ -1940,7 +1940,11 @@ async function handler(
|
||||||
originalEvent: results[0].originalEvent,
|
originalEvent: results[0].originalEvent,
|
||||||
};
|
};
|
||||||
|
|
||||||
const googleCalResult = results.find((result) => result.type === "google_calendar");
|
// Find index of google_calendar inside createManager.referencesToCreate
|
||||||
|
const googleCalIndex = createManager.referencesToCreate.findIndex(
|
||||||
|
(ref) => ref.type === "google_calendar"
|
||||||
|
);
|
||||||
|
const googleCalResult = results[googleCalIndex];
|
||||||
|
|
||||||
if (!googleCalResult) {
|
if (!googleCalResult) {
|
||||||
results.push({
|
results.push({
|
||||||
|
@ -1955,6 +1959,20 @@ async function handler(
|
||||||
...googleMeetResult,
|
...googleMeetResult,
|
||||||
success: true,
|
success: true,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// Add google_meet to referencesToCreate in the same index as google_calendar
|
||||||
|
createManager.referencesToCreate[googleCalIndex] = {
|
||||||
|
...createManager.referencesToCreate[googleCalIndex],
|
||||||
|
meetingUrl: googleCalResult.createdEvent.hangoutLink,
|
||||||
|
};
|
||||||
|
|
||||||
|
// Also create a new referenceToCreate with type video for google_meet
|
||||||
|
createManager.referencesToCreate.push({
|
||||||
|
type: "google_meet_video",
|
||||||
|
meetingUrl: googleCalResult.createdEvent.hangoutLink,
|
||||||
|
uid: googleCalResult.uid,
|
||||||
|
credentialId: createManager.referencesToCreate[googleCalIndex].credentialId,
|
||||||
|
});
|
||||||
} else if (googleCalResult && !googleCalResult.createdEvent?.hangoutLink) {
|
} else if (googleCalResult && !googleCalResult.createdEvent?.hangoutLink) {
|
||||||
results.push({
|
results.push({
|
||||||
...googleMeetResult,
|
...googleMeetResult,
|
||||||
|
|
Loading…
Reference in New Issue