Skip to content

Commit c1112ab

Browse files
fix: extract clientId header manually apiv2 (Revert) (#17832)
This reverts commit b0bf87f.
1 parent 34d4c3d commit c1112ab

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

apps/api/v2/src/ee/bookings/2024-04-15/controllers/bookings.controller.ts

+12-12
Original file line numberDiff line numberDiff line change
@@ -160,10 +160,10 @@ export class BookingsController_2024_04_15 {
160160
@Post("/")
161161
async createBooking(
162162
@Req() req: BookingRequest,
163-
@Body() body: CreateBookingInput_2024_04_15
163+
@Body() body: CreateBookingInput_2024_04_15,
164+
@Headers(X_CAL_CLIENT_ID) clientId?: string
164165
): Promise<ApiResponse<Partial<BookingResponse>>> {
165-
const clientIdHeader = req.get(X_CAL_CLIENT_ID);
166-
const oAuthClientId = clientIdHeader?.toString();
166+
const oAuthClientId = clientId?.toString();
167167
const { orgSlug, locationUrl } = body;
168168
req.headers["x-cal-force-slug"] = orgSlug;
169169
try {
@@ -191,10 +191,10 @@ export class BookingsController_2024_04_15 {
191191
async cancelBooking(
192192
@Req() req: BookingRequest,
193193
@Param("bookingId") bookingId: string,
194-
@Body() _: CancelBookingInput_2024_04_15
194+
@Body() _: CancelBookingInput_2024_04_15,
195+
@Headers(X_CAL_CLIENT_ID) clientId?: string
195196
): Promise<ApiResponse<{ bookingId: number; bookingUid: string; onlyRemovedAttendee: boolean }>> {
196-
const clientIdHeader = req.get(X_CAL_CLIENT_ID);
197-
const oAuthClientId = clientIdHeader?.toString();
197+
const oAuthClientId = clientId?.toString();
198198
if (bookingId) {
199199
try {
200200
req.body.id = parseInt(bookingId);
@@ -245,10 +245,10 @@ export class BookingsController_2024_04_15 {
245245
@Post("/recurring")
246246
async createRecurringBooking(
247247
@Req() req: BookingRequest,
248-
@Body() _: CreateRecurringBookingInput_2024_04_15[]
248+
@Body() _: CreateRecurringBookingInput_2024_04_15[],
249+
@Headers(X_CAL_CLIENT_ID) clientId?: string
249250
): Promise<ApiResponse<BookingResponse[]>> {
250-
const clientIdHeader = req.get(X_CAL_CLIENT_ID);
251-
const oAuthClientId = clientIdHeader?.toString();
251+
const oAuthClientId = clientId?.toString();
252252
try {
253253
const recurringEventId = uuidv4();
254254
for (const recurringEvent of req.body) {
@@ -283,10 +283,10 @@ export class BookingsController_2024_04_15 {
283283
@Post("/instant")
284284
async createInstantBooking(
285285
@Req() req: BookingRequest,
286-
@Body() _: CreateBookingInput_2024_04_15
286+
@Body() _: CreateBookingInput_2024_04_15,
287+
@Headers(X_CAL_CLIENT_ID) clientId?: string
287288
): Promise<ApiResponse<Awaited<ReturnType<typeof handleInstantMeeting>>>> {
288-
const clientIdHeader = req.get(X_CAL_CLIENT_ID);
289-
const oAuthClientId = clientIdHeader?.toString();
289+
const oAuthClientId = clientId?.toString();
290290
req.userId = (await this.getOwnerId(req)) ?? -1;
291291
try {
292292
const instantMeeting = await handleInstantMeeting(

0 commit comments

Comments
 (0)