Files
calendar/apps/web/modules/bookings/lib/buildBookingLink.ts
T
4407a1952c feat: add booking details sheet for /bookings (#24795)
* spike: initial booking detail sheet

* rename button

* revert some changes

* remove unnecessary test

* disable booking details sheet

---------

Co-authored-by: Eunjae Lee <hey@eunjae.dev>
Co-authored-by: Udit Takkar <53316345+Udit-takkar@users.noreply.github.com>
2025-11-11 08:40:55 -03:00

25 lines
721 B
TypeScript

/**
* Builds a booking link with query parameters
* @param bookingUid - The unique identifier for the booking
* @param allRemainingBookings - Whether to include all remaining bookings
* @param email - Optional email of the attendee
* @returns The formatted booking link with query parameters
*/
export function buildBookingLink({
bookingUid,
allRemainingBookings,
email,
}: {
bookingUid: string;
allRemainingBookings: boolean;
email?: string | null;
}): string {
const urlSearchParams = new URLSearchParams({
allRemainingBookings: allRemainingBookings.toString(),
});
if (email) {
urlSearchParams.set("email", email);
}
return `/booking/${bookingUid}?${urlSearchParams.toString()}`;
}