1export class UserDto {
2 @IsEmail()
3 readonly email: string;
4
5 @IsOptional()
6 @IsEnum(Permissions, { each: true })
7 readonly permissions: Permissions[]; <- How to validate this?
8}
1class PermissionDto {
2 @IsEnum(EPermission)
3 permission: EPermission
4}
5
6export class UserDto {
7 @IsEmail()
8 readonly email: string;
9
10 @IsArray()
11 @ValidateNested()
12 @Type(() => PermissionDto)
13 @IsOptional()
14 readonly permissions: PermissionDto[]; <- That is How to validate this?
15}