forked from Yara724/api
Fix SMS, and added pagination+sorting+searching for GETs
This commit is contained in:
@@ -1,12 +1,16 @@
|
||||
import { ApiProperty, ApiPropertyOptional } from "@nestjs/swagger";
|
||||
import { IsNotEmpty, IsOptional, IsString, MaxLength } from "class-validator";
|
||||
import { UserModel } from "src/users/entities/schema/user.schema";
|
||||
|
||||
export class UserLoginDto {
|
||||
@ApiProperty({
|
||||
example: "09226187419",
|
||||
type: "string",
|
||||
description: "User login dto",
|
||||
description: "Mobile number (username for OTP login)",
|
||||
})
|
||||
@IsString()
|
||||
@IsNotEmpty()
|
||||
@MaxLength(20)
|
||||
mobile: string;
|
||||
|
||||
@ApiPropertyOptional({
|
||||
@@ -14,6 +18,9 @@ export class UserLoginDto {
|
||||
type: "string",
|
||||
description: "Raw token from linked SMS URL (?token=...).",
|
||||
})
|
||||
@IsOptional()
|
||||
@IsString()
|
||||
@MaxLength(128)
|
||||
linkToken?: string;
|
||||
|
||||
@ApiPropertyOptional({
|
||||
@@ -21,6 +28,9 @@ export class UserLoginDto {
|
||||
type: "string",
|
||||
description: "Optional route/context hint for linked SMS login.",
|
||||
})
|
||||
@IsOptional()
|
||||
@IsString()
|
||||
@MaxLength(64)
|
||||
linkContext?: string;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,18 +1,25 @@
|
||||
import { ApiProperty, ApiPropertyOptional } from "@nestjs/swagger";
|
||||
import { IsNotEmpty, IsOptional, IsString, MaxLength } from "class-validator";
|
||||
|
||||
export class UserVerifyOtp {
|
||||
@ApiProperty({
|
||||
example: "09226187419",
|
||||
type: "string",
|
||||
description: "User login dto",
|
||||
description: "Mobile number (same value sent to send-otp)",
|
||||
})
|
||||
@IsString()
|
||||
@IsNotEmpty()
|
||||
@MaxLength(20)
|
||||
username: string;
|
||||
|
||||
@ApiProperty({
|
||||
example: "258567",
|
||||
type: "string",
|
||||
description: "User login verify dto",
|
||||
description: "OTP code from SMS",
|
||||
})
|
||||
@IsString()
|
||||
@IsNotEmpty()
|
||||
@MaxLength(16)
|
||||
password: string;
|
||||
|
||||
@ApiPropertyOptional({
|
||||
@@ -20,6 +27,9 @@ export class UserVerifyOtp {
|
||||
type: "string",
|
||||
description: "Raw token from linked SMS URL (?token=...).",
|
||||
})
|
||||
@IsOptional()
|
||||
@IsString()
|
||||
@MaxLength(128)
|
||||
linkToken?: string;
|
||||
|
||||
@ApiPropertyOptional({
|
||||
@@ -27,5 +37,8 @@ export class UserVerifyOtp {
|
||||
type: "string",
|
||||
description: "Optional route/context hint for linked SMS login.",
|
||||
})
|
||||
@IsOptional()
|
||||
@IsString()
|
||||
@MaxLength(64)
|
||||
linkContext?: string;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user