fix: Meeting URL does not save when changing the location to Gmeet or any static app (#17840)
* fix: meetingurl does not save when we change location * update * fix type error --------- Co-authored-by: Alex van Andel <me@alexvanandel.com>
This commit is contained in:
1 parent
27cd2457e8
commit
262738f288
2 files changed
+20
-18
No files matched your search
@@ -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 "";
|
||||
};
|
||||
|
||||
|
||||
@@ -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) {
|
||||
|
||||
Reference in new issue
Block a user