fix: preserve description for event type (#25726)
This commit is contained in:
1 parent
e20cc960f1
commit
19cadd18e3
1 file changed
+27
-26
@@ -35,8 +35,8 @@ import { handlePayment } from "@calcom/features/bookings/lib/handlePayment";
|
||||
import { handleWebhookTrigger } from "@calcom/features/bookings/lib/handleWebhookTrigger";
|
||||
import { isEventTypeLoggingEnabled } from "@calcom/features/bookings/lib/isEventTypeLoggingEnabled";
|
||||
import { BookingEventHandlerService } from "@calcom/features/bookings/lib/onBookingEvents/BookingEventHandlerService";
|
||||
import { BookingEmailAndSmsTasker } from "@calcom/features/bookings/lib/tasker/BookingEmailAndSmsTasker";
|
||||
import type { BookingRescheduledPayload } from "@calcom/features/bookings/lib/onBookingEvents/types.d";
|
||||
import { BookingEmailAndSmsTasker } from "@calcom/features/bookings/lib/tasker/BookingEmailAndSmsTasker";
|
||||
import { getSpamCheckService } from "@calcom/features/di/watchlist/containers/SpamCheckService.container";
|
||||
import { CreditService } from "@calcom/features/ee/billing/credit-service";
|
||||
import { getBookerBaseUrl } from "@calcom/features/ee/organizations/lib/getBookerUrlServer";
|
||||
@@ -456,7 +456,6 @@ function buildBookingCreatedPayload({
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
export interface IBookingServiceDependencies {
|
||||
checkBookingAndDurationLimitsService: CheckBookingAndDurationLimitsService;
|
||||
prismaClient: PrismaClient;
|
||||
@@ -1310,9 +1309,9 @@ async function handler(
|
||||
// This ensures that createMeeting isn't called for static video apps as bookingLocation becomes just a regular value for them.
|
||||
const { bookingLocation, conferenceCredentialId } = organizerOrFirstDynamicGroupMemberDefaultLocationUrl
|
||||
? {
|
||||
bookingLocation: organizerOrFirstDynamicGroupMemberDefaultLocationUrl,
|
||||
conferenceCredentialId: undefined,
|
||||
}
|
||||
bookingLocation: organizerOrFirstDynamicGroupMemberDefaultLocationUrl,
|
||||
conferenceCredentialId: undefined,
|
||||
}
|
||||
: getLocationValueForDB(locationBodyString, eventType.locations);
|
||||
|
||||
tracingLogger.info("locationBodyString", locationBodyString);
|
||||
@@ -1358,8 +1357,8 @@ async function handler(
|
||||
const destinationCalendar = eventType.destinationCalendar
|
||||
? [eventType.destinationCalendar]
|
||||
: organizerUser.destinationCalendar
|
||||
? [organizerUser.destinationCalendar]
|
||||
: null;
|
||||
? [organizerUser.destinationCalendar]
|
||||
: null;
|
||||
|
||||
let organizerEmail = organizerUser.email || "Email-less";
|
||||
if (eventType.useEventTypeDestinationCalendarEmail && destinationCalendar?.[0]?.primaryEmail) {
|
||||
@@ -1980,18 +1979,18 @@ async function handler(
|
||||
}
|
||||
const updateManager = !skipCalendarSyncTaskCreation
|
||||
? await eventManager.reschedule(
|
||||
evt,
|
||||
originalRescheduledBooking.uid,
|
||||
undefined,
|
||||
changedOrganizer,
|
||||
previousHostDestinationCalendar,
|
||||
isBookingRequestedReschedule,
|
||||
skipDeleteEventsAndMeetings
|
||||
)
|
||||
evt,
|
||||
originalRescheduledBooking.uid,
|
||||
undefined,
|
||||
changedOrganizer,
|
||||
previousHostDestinationCalendar,
|
||||
isBookingRequestedReschedule,
|
||||
skipDeleteEventsAndMeetings
|
||||
)
|
||||
: placeholderCreatedEvent;
|
||||
// This gets overridden when updating the event - to check if notes have been hidden or not. We just reset this back
|
||||
// to the default description when we are sending the emails.
|
||||
evt.description = eventType.description;
|
||||
evt.description = eventType.description ?? evt.description;
|
||||
|
||||
results = updateManager.results;
|
||||
referencesToCreate = updateManager.referencesToCreate;
|
||||
@@ -2288,8 +2287,8 @@ async function handler(
|
||||
|
||||
const metadata = videoCallUrl
|
||||
? {
|
||||
videoCallUrl: getVideoCallUrlFromCalEvent(evt) || videoCallUrl,
|
||||
}
|
||||
videoCallUrl: getVideoCallUrlFromCalEvent(evt) || videoCallUrl,
|
||||
}
|
||||
: undefined;
|
||||
|
||||
const bookingCreatedPayload = buildBookingCreatedPayload({
|
||||
@@ -2303,10 +2302,12 @@ async function handler(
|
||||
|
||||
const bookingRescheduledPayload: BookingRescheduledPayload = {
|
||||
...bookingCreatedPayload,
|
||||
oldBooking: originalRescheduledBooking ? {
|
||||
startTime: originalRescheduledBooking.startTime,
|
||||
endTime: originalRescheduledBooking.endTime,
|
||||
} : undefined,
|
||||
oldBooking: originalRescheduledBooking
|
||||
? {
|
||||
startTime: originalRescheduledBooking.startTime,
|
||||
endTime: originalRescheduledBooking.endTime,
|
||||
}
|
||||
: undefined,
|
||||
};
|
||||
|
||||
const bookingEventHandler = deps.bookingEventHandler;
|
||||
@@ -2382,9 +2383,9 @@ async function handler(
|
||||
...eventType,
|
||||
metadata: eventType.metadata
|
||||
? {
|
||||
...eventType.metadata,
|
||||
apps: eventType.metadata?.apps as Prisma.JsonValue,
|
||||
}
|
||||
...eventType.metadata,
|
||||
apps: eventType.metadata?.apps as Prisma.JsonValue,
|
||||
}
|
||||
: {},
|
||||
},
|
||||
paymentAppCredentials: eventTypePaymentAppCredential as IEventTypePaymentCredentialType,
|
||||
@@ -2718,7 +2719,7 @@ async function handler(
|
||||
* We are open to renaming it to something more descriptive.
|
||||
*/
|
||||
export class RegularBookingService implements IBookingService {
|
||||
constructor(private readonly deps: IBookingServiceDependencies) { }
|
||||
constructor(private readonly deps: IBookingServiceDependencies) {}
|
||||
|
||||
async createBooking(input: { bookingData: CreateRegularBookingData; bookingMeta?: CreateBookingMeta }) {
|
||||
return handler({ bookingData: input.bookingData, ...input.bookingMeta }, this.deps);
|
||||
|
||||
Reference in new issue
Block a user