From dff89a4df809423f92ffac59f810391271c9541f Mon Sep 17 00:00:00 2001 From: Rahul Roy <41847534+rad10wave@users.noreply.github.com> Date: Fri, 3 Nov 2023 16:59:41 +0530 Subject: [PATCH] feat: #11922 Removed error for cancelling past time slots (#12126) Co-authored-by: Rahul Roy --- apps/api/pages/api/bookings/[id]/_delete.ts | 4 ---- packages/features/bookings/lib/handleCancelBooking.ts | 4 ---- 2 files changed, 8 deletions(-) diff --git a/apps/api/pages/api/bookings/[id]/_delete.ts b/apps/api/pages/api/bookings/[id]/_delete.ts index a1cdbc9c3e..d67a9bb4df 100644 --- a/apps/api/pages/api/bookings/[id]/_delete.ts +++ b/apps/api/pages/api/bookings/[id]/_delete.ts @@ -56,10 +56,6 @@ import { schemaQueryIdParseInt } from "~/lib/validations/shared/queryIdTransform * The provided id didn't correspond to any existing booking. * * - * Cannot cancel past events - * The provided id matched an existing booking with a past startDate. - * - * * User not found * The userId did not matched an existing user. * diff --git a/packages/features/bookings/lib/handleCancelBooking.ts b/packages/features/bookings/lib/handleCancelBooking.ts index b4fb989203..de4506270a 100644 --- a/packages/features/bookings/lib/handleCancelBooking.ts +++ b/packages/features/bookings/lib/handleCancelBooking.ts @@ -129,10 +129,6 @@ async function handler(req: CustomRequest) { throw new HttpError({ statusCode: 400, message: "Booking not found" }); } - if (userId !== bookingToDelete.user?.id && bookingToDelete.startTime < new Date()) { - throw new HttpError({ statusCode: 400, message: "Cannot cancel past events" }); - } - if (!bookingToDelete.userId) { throw new HttpError({ statusCode: 400, message: "User not found" }); }