diff --git a/src/user/dto/create-user.dto.ts b/src/user/dto/create-user.dto.ts index e6d6014..bc9d2f2 100644 --- a/src/user/dto/create-user.dto.ts +++ b/src/user/dto/create-user.dto.ts @@ -1,5 +1,12 @@ +import { IsEmail, IsNotEmpty, MinLength } from 'class-validator'; export class CreateUserDto { + @IsNotEmpty() name: string; + + @IsEmail() email: string; + + @IsNotEmpty() + @MinLength(6) //Confirm the minlength we are using password: string; } diff --git a/src/user/dto/update-user.dto.ts b/src/user/dto/update-user.dto.ts index 2946790..7dac3d8 100644 --- a/src/user/dto/update-user.dto.ts +++ b/src/user/dto/update-user.dto.ts @@ -1,5 +1,13 @@ +import { IsEmail, IsOptional, MinLength } from 'class-validator'; export class UpdateUserDto { + @IsOptional() name?: string; + + @IsOptional() + @IsEmail() email?: string; + + @IsOptional() + @MinLength(6) password?: string; }