Skip to content

Scheduling infrastructure for absolutely everyone.

fix: Meeting URL does not save when changing the location to Gmeet or any static app (#17840)

Anik Dhabal Babu262738f28846
diff --git a/packages/lib/CalEventParser.ts b/packages/lib/CalEventParser.ts
index 5afa4ebd2b3..d851f7f9f3d 100644
--- a/packages/lib/CalEventParser.ts
+++ b/packages/lib/CalEventParser.ts
@@ -378,7 +378,7 @@ export const getPublicVideoCallUrl = (calEvent: Pick<CalendarEvent, "uid">): str
export const getVideoCallUrlFromCalEvent = (
calEvent: Parameters<typeof getPublicVideoCallUrl>[0] &
- Pick<CalendarEvent, "videoCallData" | "additionalInformation">
+ Pick<CalendarEvent, "videoCallData" | "additionalInformation" | "location">
): string => {
if (calEvent.videoCallData) {
if (isDailyVideoCall(calEvent)) {
@@ -389,6 +389,9 @@ export const getVideoCallUrlFromCalEvent = (
if (calEvent.additionalInformation?.hangoutLink) {
return calEvent.additionalInformation.hangoutLink;
}
+ if (calEvent.location?.startsWith("http")) {
+ return calEvent.location;
+ }
return "";
};
diff --git a/packages/trpc/server/routers/viewer/bookings/editLocation.handler.ts b/packages/trpc/server/routers/viewer/bookings/editLocation.handler.ts
index 3bf85bbf7d7..acf5e37cf2a 100644
--- a/packages/trpc/server/routers/viewer/bookings/editLocation.handler.ts
+++ b/packages/trpc/server/routers/viewer/bookings/editLocation.handler.ts
@@ -10,7 +10,6 @@ import logger from "@calcom/lib/logger";
import { safeStringify } from "@calcom/lib/safeStringify";
import { getTranslation } from "@calcom/lib/server";
import { getUsersCredentials } from "@calcom/lib/server/getUsersCredentials";
-import { BookingRepository } from "@calcom/lib/server/repository/booking";
import { CredentialRepository } from "@calcom/lib/server/repository/credential";
import { UserRepository } from "@calcom/lib/server/repository/user";
import { prisma } from "@calcom/prisma";
@@ -82,6 +81,7 @@ async function updateBookingLocationInDb({
booking: {
id: number;
metadata: Booking["metadata"];
+ responses: Booking["responses"];
};
evt: Ensure<CalendarEvent, "location">;
referencesToCreate: Prisma.BookingReferenceCreateInput[];
@@ -90,20 +90,6 @@ async function updateBookingLocationInDb({
videoCallUrl: getVideoCallUrlFromCalEvent(evt),
};
- await BookingRepository.updateLocationById({
- data: {
- location: evt.location,
- metadata: {
- ...(typeof booking.metadata === "object" && booking.metadata),
- ...bookingMetadataUpdate,
- },
- referencesToCreate,
- },
- where: {
- id: booking.id,
- },
- });
-
await prisma.booking.update({
where: {
id: booking.id,
@@ -117,6 +103,13 @@ async function updateBookingLocationInDb({
references: {
create: referencesToCreate,
},
+ responses: {
+ ...(typeof booking.responses === "object" && booking.responses),
+ location: {
+ value: evt.location,
+ optionValue: "",
+ },
+ },
},
});
}
@@ -274,11 +267,17 @@ export async function editLocationHandler({ ctx, input }: EditLocationOptions) {
evt,
});
- await updateBookingLocationInDb({ booking, evt, referencesToCreate: updatedResult.referencesToCreate });
+ const additionalInformation = extractAdditionalInformation(updatedResult.results[0]);
+
+ await updateBookingLocationInDb({
+ booking,
+ evt: { ...evt, additionalInformation },
+ referencesToCreate: updatedResult.referencesToCreate,
+ });
try {
await sendLocationChangeEmailsAndSMS(
- { ...evt, additionalInformation: extractAdditionalInformation(updatedResult.results[0]) },
+ { ...evt, additionalInformation },
booking?.eventType?.metadata as EventTypeMetadata
);
} catch (error) {