From 915a0fa143f0c6a91237a37cbc0ad6f1bec29c71 Mon Sep 17 00:00:00 2001 From: Ash D Date: Thu, 13 Feb 2025 08:41:13 +1100 Subject: [PATCH 1/2] fix: cancelledby to work on api v1 --- apps/api/v1/pages/api/bookings/[id]/_delete.ts | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/apps/api/v1/pages/api/bookings/[id]/_delete.ts b/apps/api/v1/pages/api/bookings/[id]/_delete.ts index 421302d405ab61..74caa3d98ba6c2 100644 --- a/apps/api/v1/pages/api/bookings/[id]/_delete.ts +++ b/apps/api/v1/pages/api/bookings/[id]/_delete.ts @@ -38,6 +38,12 @@ import { schemaQueryIdParseInt } from "~/lib/validations/shared/queryIdTransform * schema: * type: string * description: The reason for cancellation of the booking + * - in: query + * name: cancelledBy + * required: false + * schema: + * type: string + * description: The email of who cancelled the booking * tags: * - bookings * responses: @@ -64,15 +70,17 @@ import { schemaQueryIdParseInt } from "~/lib/validations/shared/queryIdTransform * description: User not found */ async function handler(req: NextApiRequest) { - const { id, allRemainingBookings, cancellationReason } = schemaQueryIdParseInt - .merge(bookingCancelSchema.pick({ allRemainingBookings: true, cancellationReason: true })) + const { id, allRemainingBookings, cancellationReason, cancelledBy } = schemaQueryIdParseInt + .merge( + bookingCancelSchema.pick({ allRemainingBookings: true, cancellationReason: true, cancelledBy: true }) + ) .parse({ ...req.query, allRemainingBookings: req.query.allRemainingBookings === "true", }); // Normalizing for universal handler - req.body = { id, allRemainingBookings, cancellationReason }; + req.body = { id, allRemainingBookings, cancellationReason, cancelledBy }; return await handleCancelBooking(req); } From 1b890c2c7ff1e404c34b067821789ae7264a319a Mon Sep 17 00:00:00 2001 From: Ash D Date: Thu, 20 Feb 2025 09:42:03 +1100 Subject: [PATCH 2/2] fix: scheduleId to work with hosts in eventtype api v1 --- apps/api/v1/lib/validations/event-type.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/apps/api/v1/lib/validations/event-type.ts b/apps/api/v1/lib/validations/event-type.ts index f475a18b843b47..08ab2790de3811 100644 --- a/apps/api/v1/lib/validations/event-type.ts +++ b/apps/api/v1/lib/validations/event-type.ts @@ -22,6 +22,7 @@ const recurringEventInputSchema = z.object({ const hostSchema = _HostModel.pick({ isFixed: true, userId: true, + scheduleId: true, }); export const childrenSchema = z.object({