From b0bf87f3ed19c51ada78edae42824cbf1f705e21 Mon Sep 17 00:00:00 2001 From: Morgan <33722304+ThyMinimalDev@users.noreply.github.com> Date: Fri, 22 Nov 2024 00:46:13 +0200 Subject: [PATCH] fix: extract clientId header manually apiv2 (#17783) --- .../controllers/bookings.controller.ts | 24 +++++++++---------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/apps/api/v2/src/ee/bookings/2024-04-15/controllers/bookings.controller.ts b/apps/api/v2/src/ee/bookings/2024-04-15/controllers/bookings.controller.ts index 23299b8d69..586bf2c731 100644 --- a/apps/api/v2/src/ee/bookings/2024-04-15/controllers/bookings.controller.ts +++ b/apps/api/v2/src/ee/bookings/2024-04-15/controllers/bookings.controller.ts @@ -160,10 +160,10 @@ export class BookingsController_2024_04_15 { @Post("/") async createBooking( @Req() req: BookingRequest, - @Body() body: CreateBookingInput_2024_04_15, - @Headers(X_CAL_CLIENT_ID) clientId?: string + @Body() body: CreateBookingInput_2024_04_15 ): Promise>> { - const oAuthClientId = clientId?.toString(); + const clientIdHeader = req.get(X_CAL_CLIENT_ID); + const oAuthClientId = clientIdHeader?.toString(); const { orgSlug, locationUrl } = body; req.headers["x-cal-force-slug"] = orgSlug; try { @@ -191,10 +191,10 @@ export class BookingsController_2024_04_15 { async cancelBooking( @Req() req: BookingRequest, @Param("bookingId") bookingId: string, - @Body() _: CancelBookingInput_2024_04_15, - @Headers(X_CAL_CLIENT_ID) clientId?: string + @Body() _: CancelBookingInput_2024_04_15 ): Promise> { - const oAuthClientId = clientId?.toString(); + const clientIdHeader = req.get(X_CAL_CLIENT_ID); + const oAuthClientId = clientIdHeader?.toString(); if (bookingId) { try { req.body.id = parseInt(bookingId); @@ -245,10 +245,10 @@ export class BookingsController_2024_04_15 { @Post("/recurring") async createRecurringBooking( @Req() req: BookingRequest, - @Body() _: CreateRecurringBookingInput_2024_04_15[], - @Headers(X_CAL_CLIENT_ID) clientId?: string + @Body() _: CreateRecurringBookingInput_2024_04_15[] ): Promise> { - const oAuthClientId = clientId?.toString(); + const clientIdHeader = req.get(X_CAL_CLIENT_ID); + const oAuthClientId = clientIdHeader?.toString(); try { const recurringEventId = uuidv4(); for (const recurringEvent of req.body) { @@ -283,10 +283,10 @@ export class BookingsController_2024_04_15 { @Post("/instant") async createInstantBooking( @Req() req: BookingRequest, - @Body() _: CreateBookingInput_2024_04_15, - @Headers(X_CAL_CLIENT_ID) clientId?: string + @Body() _: CreateBookingInput_2024_04_15 ): Promise>>> { - const oAuthClientId = clientId?.toString(); + const clientIdHeader = req.get(X_CAL_CLIENT_ID); + const oAuthClientId = clientIdHeader?.toString(); req.userId = (await this.getOwnerId(req)) ?? -1; try { const instantMeeting = await handleInstantMeeting(