Skip to content

Scheduling infrastructure for absolutely everyone.

fix: api v2 typing issues (#23786)

Rajiv Sahal1a8b5d145ff6
diff --git a/apps/api/v2/src/ee/calendars/controllers/calendars.controller.ts b/apps/api/v2/src/ee/calendars/controllers/calendars.controller.ts
index bb2e35ba839..cd17f220bfe 100644
--- a/apps/api/v2/src/ee/calendars/controllers/calendars.controller.ts
+++ b/apps/api/v2/src/ee/calendars/controllers/calendars.controller.ts
@@ -52,11 +52,7 @@ import {
APPLE_CALENDAR,
CREDENTIAL_CALENDARS,
} from "@calcom/platform-constants";
-import type {
- ApiResponse,
- CalendarBusyTimesInput,
- CreateCalendarCredentialsInput,
-} from "@calcom/platform-types";
+import { ApiResponse, CalendarBusyTimesInput, CreateCalendarCredentialsInput } from "@calcom/platform-types";
import type { User } from "@calcom/prisma/client";
export interface CalendarState {
diff --git a/packages/platform/types/calendars/inputs/create-calendar-credentials.input.ts b/packages/platform/types/calendars/inputs/create-calendar-credentials.input.ts
index ebfae0e4209..1eeaa87c8e8 100644
--- a/packages/platform/types/calendars/inputs/create-calendar-credentials.input.ts
+++ b/packages/platform/types/calendars/inputs/create-calendar-credentials.input.ts
@@ -1,14 +1,17 @@
import { ApiProperty } from "@nestjs/swagger";
+import { Transform } from "class-transformer";
import { IsString, MinLength } from "class-validator";
export class CreateCalendarCredentialsInput {
@IsString()
@MinLength(1)
@ApiProperty()
+ @Transform(({ value }) => value?.trim())
username!: string;
@IsString()
@MinLength(1)
@ApiProperty()
+ @Transform(({ value }) => value?.trim())
password!: string;
}