From ee5ecc263cdcbdd527f9f8e5e76b17bb02165690 Mon Sep 17 00:00:00 2001 From: bhavanakarwade Date: Mon, 14 Oct 2024 13:39:51 +0530 Subject: [PATCH] fix: refactor description and name validations Signed-off-by: bhavanakarwade --- .../src/organization/dtos/create-organization-dto.ts | 4 ++-- .../src/organization/dtos/update-organization-dto.ts | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/apps/api-gateway/src/organization/dtos/create-organization-dto.ts b/apps/api-gateway/src/organization/dtos/create-organization-dto.ts index d13cd2225..5a7a0e81e 100644 --- a/apps/api-gateway/src/organization/dtos/create-organization-dto.ts +++ b/apps/api-gateway/src/organization/dtos/create-organization-dto.ts @@ -10,7 +10,7 @@ export class CreateOrganizationDto { @Transform(({ value }) => trim(value)) @IsNotEmpty({ message: 'Organization name is required.' }) @MinLength(2, { message: 'Organization name must be at least 2 characters.' }) - @MaxLength(200, { message: 'Organization name must be at most 50 characters.' }) + @MaxLength(200, { message: 'Organization name must be at most 200 characters.' }) @IsString({ message: 'Organization name must be in string format.' }) @IsNotSQLInjection({ message: 'Organization name is required.' }) name: string; @@ -19,7 +19,7 @@ export class CreateOrganizationDto { @Transform(({ value }) => trim(value)) @IsNotEmpty({ message: 'Description is required.' }) @MinLength(2, { message: 'Description must be at least 2 characters.' }) - @MaxLength(1000, { message: 'Description must be at most 255 characters.' }) + @MaxLength(1000, { message: 'Description must be at most 1000 characters.' }) @IsString({ message: 'Description must be in string format.' }) description: string; diff --git a/apps/api-gateway/src/organization/dtos/update-organization-dto.ts b/apps/api-gateway/src/organization/dtos/update-organization-dto.ts index 525bbbb14..eb737c91c 100644 --- a/apps/api-gateway/src/organization/dtos/update-organization-dto.ts +++ b/apps/api-gateway/src/organization/dtos/update-organization-dto.ts @@ -15,7 +15,7 @@ export class UpdateOrganizationDto { @Transform(({ value }) => trim(value)) @IsNotEmpty({ message: 'Organization name is required.' }) @MinLength(2, { message: 'Organization name must be at least 2 characters.' }) - @MaxLength(200, { message: 'Organization name must be at most 50 characters.' }) + @MaxLength(200, { message: 'Organization name must be at most 200 characters.' }) @IsString({ message: 'Organization name must be in string format.' }) name: string; @@ -24,7 +24,7 @@ export class UpdateOrganizationDto { @Transform(({ value }) => trim(value)) @IsNotEmpty({ message: 'Description is required.' }) @MinLength(2, { message: 'Description must be at least 2 characters.' }) - @MaxLength(1000, { message: 'Description must be at most 255 characters.' }) + @MaxLength(1000, { message: 'Description must be at most 1000 characters.' }) @IsString({ message: 'Description must be in string format.' }) description: string;