Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: API v2 recurring spelling #14620

Merged
merged 1 commit into from
Apr 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions apps/api/v2/src/app.rewrites.middleware.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ export class RewriterMiddleware implements NestMiddleware {
if (req.url.startsWith("/v2/ee")) {
req.url = req.url.replace("/v2/ee", "/v2");
}
if (req.url.contains("reccuring")) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are people already using reccuring?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it's possible but probably nobody is since we didnt expose the hook to create recurring booking

req.url = req.url.replace("reccuring", "recurring");
}
next();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ describe("Bookings Endpoints", () => {
// };

// return request(app.getHttpServer())
// .post("/v2/bookings/reccuring")
// .post("/v2/bookings/recurring")
// .send(body)
// .expect(201)
// .then((response) => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { CreateBookingInput } from "@/ee/bookings/inputs/create-booking.input";
import { CreateReccuringBookingInput } from "@/ee/bookings/inputs/create-reccuring-booking.input";
import { CreateRecurringBookingInput } from "@/ee/bookings/inputs/create-recurring-booking.input";
import { GetBookingOutput } from "@/ee/bookings/outputs/get-booking.output";
import { GetBookingsOutput } from "@/ee/bookings/outputs/get-bookings.output";
import { GetUser } from "@/modules/auth/decorators/get-user/get-user.decorator";
Expand Down Expand Up @@ -180,10 +180,10 @@ export class BookingsController {
throw new InternalServerErrorException("Could not cancel booking.");
}

@Post("/reccuring")
async createReccuringBooking(
@Post("/recurring")
async createRecurringBooking(
@Req() req: BookingRequest,
@Body() _: CreateReccuringBookingInput[],
@Body() _: CreateRecurringBookingInput[],
@Headers(X_CAL_CLIENT_ID) clientId?: string
): Promise<ApiResponse<BookingResponse[]>> {
const oAuthClientId = clientId?.toString();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { IsBoolean, IsNumber, IsOptional } from "class-validator";

import type { AppsStatus } from "@calcom/platform-libraries";

export class CreateReccuringBookingInput extends CreateBookingInput {
export class CreateRecurringBookingInput extends CreateBookingInput {
@IsBoolean()
@IsOptional()
noEmail?: boolean;
Expand Down
6 changes: 3 additions & 3 deletions apps/api/v2/swagger/documentation.json
Original file line number Diff line number Diff line change
Expand Up @@ -1380,9 +1380,9 @@
]
}
},
"/v2/bookings/reccuring": {
"/v2/bookings/recurring": {
"post": {
"operationId": "BookingsController_createReccuringBooking",
"operationId": "BookingsController_createRecurringBooking",
"parameters": [
{
"name": "x-cal-client-id",
Expand Down Expand Up @@ -4270,4 +4270,4 @@
}
}
}
}
}
6 changes: 3 additions & 3 deletions packages/platform/sdk/src/swagger-types.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -117,8 +117,8 @@ export interface paths {
"/v2/bookings": {
post: operations["BookingsController_createBooking"];
};
"/v2/bookings/reccuring": {
post: operations["BookingsController_createReccuringBooking"];
"/v2/bookings/recurring": {
post: operations["BookingsController_createRecurringBooking"];
};
"/v2/bookings/instant": {
post: operations["BookingsController_createInstantBooking"];
Expand Down Expand Up @@ -814,7 +814,7 @@ export interface operations {
};
};
};
BookingsController_createReccuringBooking: {
BookingsController_createRecurringBooking: {
requestBody: {
content: {
"application/json": string[];
Expand Down
Loading