fix: request reschedule link in for an Org event

fix/less-recurring-bookings-failure-1
Hariom 2023-10-28 19:37:50 +05:30
parent da5f8a96b8
commit d950a9cbc4
3 changed files with 7 additions and 1 deletions

View File

@ -255,7 +255,10 @@ export class CalendarEventBuilder implements ICalendarEventBuilder {
const queryParams = new URLSearchParams();
queryParams.set("rescheduleUid", `${booking.uid}`);
slug = `${slug}`;
const rescheduleLink = `${WEBAPP_URL}/${slug}?${queryParams.toString()}`;
const rescheduleLink = `${
this.calendarEvent.bookerUrl ?? WEBAPP_URL
}/${slug}?${queryParams.toString()}`;
this.rescheduleLink = rescheduleLink;
} catch (error) {
if (error instanceof Error) {

View File

@ -9,6 +9,7 @@ import type {
} from "@calcom/types/Calendar";
class CalendarEventClass implements CalendarEvent {
bookerUrl?: string | undefined;
type!: string;
title!: string;
startTime!: string;

View File

@ -17,6 +17,7 @@ import sendPayload from "@calcom/features/webhooks/lib/sendPayload";
import { isPrismaObjOrUndefined } from "@calcom/lib";
import { getTeamIdFromEventType } from "@calcom/lib/getTeamIdFromEventType";
import { getTranslation } from "@calcom/lib/server";
import { getBookerUrl } from "@calcom/lib/server/getBookerUrl";
import { getUsersCredentials } from "@calcom/lib/server/getUsersCredentials";
import { prisma } from "@calcom/prisma";
import type { WebhookTriggerEvents } from "@calcom/prisma/enums";
@ -167,6 +168,7 @@ export const requestRescheduleHandler = async ({ ctx, input }: RequestReschedule
const builder = new CalendarEventBuilder();
builder.init({
title: bookingToReschedule.title,
bookerUrl: await getBookerUrl(user),
type: event && event.title ? event.title : bookingToReschedule.title,
startTime: bookingToReschedule.startTime.toISOString(),
endTime: bookingToReschedule.endTime.toISOString(),