forked from Yara724/api
YARA-1035
This commit is contained in:
2
src/features/user/dtos/index.ts
Normal file
2
src/features/user/dtos/index.ts
Normal file
@@ -0,0 +1,2 @@
|
||||
export { UserRegisterDto } from "./requests/user-register.dto";
|
||||
export { UserLoginDto } from "./requests/user-login.dto";
|
||||
16
src/features/user/dtos/requests/user-login.dto.ts
Normal file
16
src/features/user/dtos/requests/user-login.dto.ts
Normal file
@@ -0,0 +1,16 @@
|
||||
import {
|
||||
IsMobilePhone,
|
||||
IsNumberString,
|
||||
IsString,
|
||||
Length,
|
||||
} from "class-validator";
|
||||
|
||||
export class UserLoginDto {
|
||||
@IsString({ message: "Cellphone number must be string" })
|
||||
@IsMobilePhone("fa-IR")
|
||||
cellphoneNumber: string;
|
||||
|
||||
@IsNumberString()
|
||||
@Length(4, 6)
|
||||
otp: string;
|
||||
}
|
||||
7
src/features/user/dtos/requests/user-register.dto.ts
Normal file
7
src/features/user/dtos/requests/user-register.dto.ts
Normal file
@@ -0,0 +1,7 @@
|
||||
import { IsMobilePhone, IsString } from "class-validator";
|
||||
|
||||
export class UserRegisterDto {
|
||||
@IsString({ message: "Cellphone number must be string" })
|
||||
@IsMobilePhone("fa-IR")
|
||||
cellphoneNumber: string;
|
||||
}
|
||||
Reference in New Issue
Block a user