feat(dto): enforce field length constraints across DTOs
Add `@MaxLength` validations to limit string field lengths in multiple DTOs, ensuring consistent data validation and integrity. Integrate `CreateApiKeyDto` in the API keys controller for improved type safety.
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import { IsEnum, IsOptional, IsString, IsUUID } from "class-validator";
|
||||
import { IsEnum, IsOptional, IsString, IsUUID, MaxLength } from "class-validator";
|
||||
|
||||
export enum ReportReason {
|
||||
INAPPROPRIATE = "inappropriate",
|
||||
@@ -21,5 +21,6 @@ export class CreateReportDto {
|
||||
|
||||
@IsOptional()
|
||||
@IsString()
|
||||
@MaxLength(1000)
|
||||
description?: string;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user