forked from Yara724/api
New module for expert field
This commit is contained in:
32
src/expert-initiated/dtos/login.dto.ts
Normal file
32
src/expert-initiated/dtos/login.dto.ts
Normal file
@@ -0,0 +1,32 @@
|
||||
import { ApiProperty } from "@nestjs/swagger";
|
||||
import { IsEmail, IsNotEmpty, IsString } from "class-validator";
|
||||
|
||||
export class FieldExpertLoginDto {
|
||||
@ApiProperty()
|
||||
@IsEmail({ allow_underscores: true })
|
||||
@IsString({
|
||||
message: "email is not string",
|
||||
context: {
|
||||
errorCode: 4000,
|
||||
note: "The validated email type must be string",
|
||||
},
|
||||
})
|
||||
readonly email: string;
|
||||
|
||||
@ApiProperty()
|
||||
@IsNotEmpty({
|
||||
message: "password is empty",
|
||||
context: {
|
||||
errorCode: 4001,
|
||||
note: "The validated password must not be empty",
|
||||
},
|
||||
})
|
||||
@IsString({
|
||||
message: "password is not string",
|
||||
context: {
|
||||
errorCode: 4002,
|
||||
note: "The validated password type must be string",
|
||||
},
|
||||
})
|
||||
readonly password: string;
|
||||
}
|
||||
Reference in New Issue
Block a user