diff --git a/packages/features/bookings/lib/handleCancelBooking.ts b/packages/features/bookings/lib/handleCancelBooking.ts index ee88e04e0014a3..a1b841999089b5 100644 --- a/packages/features/bookings/lib/handleCancelBooking.ts +++ b/packages/features/bookings/lib/handleCancelBooking.ts @@ -43,7 +43,7 @@ import cancelAttendeeSeat from "./handleSeats/cancel/cancelAttendeeSeat"; const log = logger.getSubLogger({ prefix: ["handleCancelBooking"] }); async function getBookingToDelete(id: number | undefined, uid: string | undefined) { - return await prisma.booking.findUnique({ + return await prisma.booking.findUniqueOrThrow({ where: { id, uid, @@ -172,10 +172,6 @@ async function handler(req: CustomRequest) { arePlatformEmailsEnabled, } = req; - if (!bookingToDelete || !bookingToDelete.user) { - throw new HttpError({ statusCode: 400, message: "Booking not found" }); - } - if (!bookingToDelete.userId) { throw new HttpError({ statusCode: 400, message: "User not found" }); }