- Create CreateCommentDto class with proper validation decorators - Update comment controller to use the DTO for request body - This resolves the global ValidationPipe rejection due to forbidNonWhitelisted - Set MaxLength to 50000 to match manual validation logic Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
20 lines
280 B
TypeScript
20 lines
280 B
TypeScript
import {
|
|
IsString,
|
|
IsOptional,
|
|
IsArray,
|
|
MinLength,
|
|
MaxLength,
|
|
} from 'class-validator';
|
|
|
|
export class CreateCommentDto {
|
|
@IsString()
|
|
@MinLength(1)
|
|
@MaxLength(50000)
|
|
content: string;
|
|
|
|
@IsOptional()
|
|
@IsArray()
|
|
@IsString({ each: true })
|
|
files?: string[];
|
|
}
|