forked from Yara724/api
33 lines
752 B
TypeScript
33 lines
752 B
TypeScript
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;
|
|
}
|