fix: Fix calendar event included in the workflow, doesn't show the meeting link (#13872)

* Fix calendar event included in the workflow, doesn't show the meeting link

* Fix type error

* fix public video call url

---------

Co-authored-by: CarinaWolli <wollencarina@gmail.com>
This commit is contained in:
Anwar SadathandCarinaWolli authored and GitHub committed 2024-02-27 15:50:40 +00:00
1 parent 5d1976295c
commit 86c379817e
2 files changed
+9 -3

No files matched your search

@@ -2291,8 +2291,7 @@ async function handler(
loggerWithEventDetails.error("Error while creating booking references", JSON.stringify({ error }));
}
const metadataFromEvent = videoCallUrl ? { videoCallUrl } : undefined;
const evtWithMetadata = { ...evt, metadata: metadataFromEvent, eventType: { slug: eventType.slug } };
const evtWithMetadata = { ...evt, metadata, eventType: { slug: eventType.slug } };
await scheduleMandatoryReminder(
evtWithMetadata,
@@ -5,6 +5,7 @@ import type { DateArray } from "ics";
import { RRule } from "rrule";
import { v4 as uuidv4 } from "uuid";
import { guessEventLocationType } from "@calcom/app-store/locations";
import dayjs from "@calcom/dayjs";
import { preprocessNameFieldDataWithVariant } from "@calcom/features/form-builder/utils";
import logger from "@calcom/lib/logger";
@@ -33,6 +34,12 @@ function getiCalEventAsString(evt: BookingInfo, status?: ParticipationStatus) {
recurrenceRule = new RRule(evt.eventType.recurringEvent).toString().replace("RRULE:", "");
}
let location = bookingMetadataSchema.parse(evt.metadata || {})?.videoCallUrl;
if (!location) {
location = guessEventLocationType(location)?.label || evt.location || "";
}
const icsEvent = createEvent({
uid,
startInputType: "utc",
@@ -44,7 +51,7 @@ function getiCalEventAsString(evt: BookingInfo, status?: ParticipationStatus) {
duration: { minutes: dayjs(evt.endTime).diff(dayjs(evt.startTime), "minute") },
title: evt.title,
description: evt.additionalNotes || "",
location: evt.location || "",
location,
organizer: { email: evt.organizer.email || "", name: evt.organizer.name },
attendees: [
{