FullStack-Blog-Nestjs-Nextjs-Postgres
This commit is contained in:
20
backend/src/users/dto/create-user.dto.ts
Normal file
20
backend/src/users/dto/create-user.dto.ts
Normal file
@@ -0,0 +1,20 @@
|
||||
import { IsEmail, IsEnum, IsOptional, IsString, MinLength } from 'class-validator';
|
||||
import { UserRole } from '../entities/user.entity';
|
||||
|
||||
export class CreateUserDto {
|
||||
@IsEmail()
|
||||
email: string;
|
||||
|
||||
@IsString()
|
||||
@IsOptional()
|
||||
name?: string;
|
||||
|
||||
@IsEnum(UserRole)
|
||||
@IsOptional()
|
||||
role?: UserRole;
|
||||
|
||||
@IsString()
|
||||
@MinLength(8)
|
||||
@IsOptional()
|
||||
password?: string;
|
||||
}
|
||||
Reference in New Issue
Block a user