From 1a8b5d145ff646c29666c9ebde64299c2596c140 Mon Sep 17 00:00:00 2001 From: Rajiv Sahal Date: Fri, 12 Sep 2025 22:57:56 +0530 Subject: [PATCH] fix: api v2 typing issues (#23786) * fix: move validateRoundRobinSlotAvailability to core libraries * fix: imports * fix: update CreateCalendarCredentialsInput DTO * cleanup --- .../v2/src/ee/calendars/controllers/calendars.controller.ts | 6 +----- .../calendars/inputs/create-calendar-credentials.input.ts | 3 +++ 2 files changed, 4 insertions(+), 5 deletions(-) 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 bb2e35ba83..cd17f220bf 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 ebfae0e420..1eeaa87c8e 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; }