fix: strip internal $RCH$ prefix from cancellation reason in ICS files (#25016)
* fix: strip internal RCH prefix from cancellation reason used in ICS * fixed * trimmed
This commit is contained in:
@@ -223,8 +223,9 @@ export const getPlatformCancelLink = (
|
||||
if (calEvent.platformCancelUrl) {
|
||||
const platformCancelLink = new URL(`${calEvent.platformCancelUrl}/${bookingUid}`);
|
||||
platformCancelLink.searchParams.append("slug", calEvent.type);
|
||||
calEvent.organizer.username &&
|
||||
if (calEvent.organizer.username) {
|
||||
platformCancelLink.searchParams.append("username", calEvent.organizer.username);
|
||||
}
|
||||
platformCancelLink.searchParams.append("cancel", "true");
|
||||
platformCancelLink.searchParams.append("allRemainingBookings", String(!!calEvent.recurringEvent));
|
||||
if (seatUid) platformCancelLink.searchParams.append("seatReferenceUid", seatUid);
|
||||
@@ -267,8 +268,9 @@ export const getPlatformRescheduleLink = (
|
||||
`${calEvent.platformRescheduleUrl}/${seatUid ? seatUid : bookingUid}`
|
||||
);
|
||||
platformRescheduleLink.searchParams.append("slug", calEvent.type);
|
||||
calEvent.organizer.username &&
|
||||
if (calEvent.organizer.username) {
|
||||
platformRescheduleLink.searchParams.append("username", calEvent.organizer.username);
|
||||
}
|
||||
platformRescheduleLink.searchParams.append("reschedule", "true");
|
||||
if (calEvent?.team) platformRescheduleLink.searchParams.append("teamId", calEvent.team.id.toString());
|
||||
return platformRescheduleLink.toString();
|
||||
@@ -408,7 +410,10 @@ export const getRichDescription = (
|
||||
|
||||
export const getCancellationReason = (calEvent: Pick<CalendarEvent, "cancellationReason">, t: TFunction) => {
|
||||
if (!calEvent.cancellationReason) return "";
|
||||
return `${t("cancellation_reason")}:\n${calEvent.cancellationReason}`;
|
||||
const sanitized = calEvent.cancellationReason.startsWith("$RCH$")
|
||||
? calEvent.cancellationReason.substring(5).trim()
|
||||
: calEvent.cancellationReason.trim();
|
||||
return `${t("cancellation_reason")}:\n${sanitized}`;
|
||||
};
|
||||
|
||||
export const isDailyVideoCall = (calEvent: Pick<CalendarEvent, "videoCallData">): boolean => {
|
||||
|
||||
Reference in New Issue
Block a user