added more security check rules in dtos

This commit is contained in:
Kevsl
2024-06-11 09:52:47 +02:00
parent 1171e5e13c
commit 0ba8b52be3
7 changed files with 82 additions and 7 deletions

View File

@@ -1,11 +1,13 @@
import { ApiProperty } from '@nestjs/swagger';
import { IsString } from 'class-validator';
import { IsString, MaxLength, MinLength } from 'class-validator';
export class RoleDto {
@ApiProperty({
type: String,
description: 'Role Name',
example: 'user',
})
@MinLength(1)
@MaxLength(50)
@IsString()
name: string;
}