fix: passing booking id in the payload (#15642)

This commit is contained in:
Udit Takkar
2024-07-03 07:25:14 +00:00
committed by GitHub
parent 92bf1ee3c7
commit 4f76d4468e
3 changed files with 4 additions and 0 deletions
+1
View File
@@ -109,6 +109,7 @@ test.describe("Bookings", () => {
message: "first@cal.com marked as no-show",
attendees: [{ email: "first@cal.com", noShow: true, utcOffset: null }],
bookingUid: bookingWhereFirstUserIsOrganizer?.uid,
bookingId: bookingWhereFirstUserIsOrganizer?.id,
},
});
webhookReceiver.close();
@@ -32,6 +32,7 @@ export type WithUTCOffsetType<T> = T & {
export type BookingNoShowUpdatedPayload = {
message: string;
bookingUid: string;
bookingId: number;
attendees: { email: string; noShow: boolean }[];
};
@@ -75,6 +75,7 @@ export const noShowHandler = async ({ input }: NoShowOptions) => {
const booking = await prisma.booking.findUnique({
where: { uid: bookingUid },
select: {
id: true,
eventType: {
select: {
id: true,
@@ -103,6 +104,7 @@ export const noShowHandler = async ({ input }: NoShowOptions) => {
// @ts-expect-error payload is too booking specific, we need to refactor this
message: t(payload.message, { x: payload.attendees[0]?.email || "User" }),
bookingUid,
bookingId: booking?.id,
});
return payload;
}