AnhLedger's picture
Phone number and email not null when signup
3cd799a
raw
history blame contribute delete
516 Bytes
import {
IsString,
IsEmail,
IsMobilePhone,
IsOptional,
IsNumber,
MinLength
} from "class-validator";
export class SignUpDto{
@IsString()
full_name: string;
@IsMobilePhone('vi-VN')
// @IsUnique('phone_number', { message: 'phone number is already registered' })
phone_number: string;
@IsOptional()
@IsEmail()
// @IsUnique('email', { message: 'Email is already registered' })
email?: string;
@IsString()
@MinLength(8)
password: string;
}