feat: add name and email url params when rescheduling past bookings (#18318)
* feat: add name and email as url params when rescheduling past bookings * remove logs * pass booking seat name and email as url params
This commit is contained in:
1 parent
cd7b93a51e
commit
6b5e144042
3 files changed
+26
-13
No files matched your search
@@ -43,6 +43,13 @@ type ResultType = {
|
||||
attendeeLastName?: string | null;
|
||||
};
|
||||
|
||||
export function getSafe<T>(obj: unknown, path: (string | number)[]): T | undefined {
|
||||
return path.reduce(
|
||||
(acc, key) => (typeof acc === "object" && acc !== null ? (acc as any)[key] : undefined),
|
||||
obj
|
||||
) as T | undefined;
|
||||
}
|
||||
|
||||
export const getBookingRedirectExtraParams = (booking: SuccessRedirectBookingType) => {
|
||||
const redirectQueryParamKeys: BookingResponseKey[] = [
|
||||
"title",
|
||||
@@ -55,13 +62,6 @@ export const getBookingRedirectExtraParams = (booking: SuccessRedirectBookingTyp
|
||||
"responses",
|
||||
];
|
||||
|
||||
function getSafe<T>(obj: unknown, path: (string | number)[]): T | undefined {
|
||||
return path.reduce(
|
||||
(acc, key) => (typeof acc === "object" && acc !== null ? (acc as any)[key] : undefined),
|
||||
obj
|
||||
) as T | undefined;
|
||||
}
|
||||
|
||||
// Helper function to extract response details (e.g., phone, attendee's first and last name)
|
||||
function extractResponseDetails(booking: SuccessRedirectBookingType, obj: ResultType): ResultType {
|
||||
const result: ResultType = { ...obj };
|
||||
|
||||
@@ -13,8 +13,9 @@ export async function maybeGetBookingUidFromSeat(prisma: PrismaClient, uid: stri
|
||||
uid: true,
|
||||
},
|
||||
},
|
||||
data: true,
|
||||
},
|
||||
});
|
||||
if (bookingSeat) return { uid: bookingSeat.booking.uid, seatReferenceUid: uid };
|
||||
if (bookingSeat) return { uid: bookingSeat.booking.uid, seatReferenceUid: uid, bookingSeat };
|
||||
return { uid };
|
||||
}
|
||||
Reference in new issue
Block a user