add a max lenght for username

This commit is contained in:
cherif
2023-01-17 10:29:32 +01:00
parent 86b8ab74a2
commit 86a507fdf6
2 changed files with 3 additions and 2 deletions

View File

@@ -1,10 +1,11 @@
import { IsBoolean, Matches, IsEmail, IsNotEmpty, IsOptional, IsString } from 'class-validator';
import { IsBoolean, Matches, MaxLength, IsEmail, IsNotEmpty, IsOptional, IsString } from 'class-validator';
import { isSet } from 'util/types';
export class CreateUsersDto {
@IsString()
@IsNotEmpty()
@Matches(/^[a-zA-Z0-9'-_]+$/)
@MaxLength(50)
readonly username: string;
readonly fortyTwoId: string;
@IsEmail()