update
This commit is contained in:
@@ -2,7 +2,7 @@ import { Controller, Post, Body } from '@nestjs/common';
|
|||||||
import { AuthService } from '../services/auth.service';
|
import { AuthService } from '../services/auth.service';
|
||||||
import { RequestOtpDto } from '../dto/request-otp.dto';
|
import { RequestOtpDto } from '../dto/request-otp.dto';
|
||||||
import { ApiTags, ApiOperation, ApiBody, ApiResponse } from '@nestjs/swagger';
|
import { ApiTags, ApiOperation, ApiBody, ApiResponse } from '@nestjs/swagger';
|
||||||
import { VerifyOtpDto } from '../dto/verify-otp.dto copy';
|
import { VerifyOtpDto } from '../dto/verify-otp.dto';
|
||||||
import { Throttle } from '@nestjs/throttler';
|
import { Throttle } from '@nestjs/throttler';
|
||||||
import { RefreshTokenRateLimit } from 'src/common/decorators/rate-limit.decorator';
|
import { RefreshTokenRateLimit } from 'src/common/decorators/rate-limit.decorator';
|
||||||
import { RefreshTokenDto } from '../dto/refresh-token.dto';
|
import { RefreshTokenDto } from '../dto/refresh-token.dto';
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ import { Controller, Post, Body } from '@nestjs/common';
|
|||||||
import { AuthService } from '../services/auth.service';
|
import { AuthService } from '../services/auth.service';
|
||||||
import { RequestOtpDto } from '../dto/request-otp.dto';
|
import { RequestOtpDto } from '../dto/request-otp.dto';
|
||||||
import { ApiTags, ApiOperation, ApiBody, ApiResponse } from '@nestjs/swagger';
|
import { ApiTags, ApiOperation, ApiBody, ApiResponse } from '@nestjs/swagger';
|
||||||
import { VerifyOtpDto } from '../dto/verify-otp.dto copy';
|
import { VerifyOtpDto } from '../dto/verify-otp.dto';
|
||||||
import { Throttle } from '@nestjs/throttler';
|
import { Throttle } from '@nestjs/throttler';
|
||||||
import { RefreshTokenRateLimit } from 'src/common/decorators/rate-limit.decorator';
|
import { RefreshTokenRateLimit } from 'src/common/decorators/rate-limit.decorator';
|
||||||
import { RefreshTokenDto } from '../dto/refresh-token.dto';
|
import { RefreshTokenDto } from '../dto/refresh-token.dto';
|
||||||
|
|||||||
@@ -1,10 +0,0 @@
|
|||||||
import { IsNotEmpty, IsString, IsMobilePhone } from 'class-validator';
|
|
||||||
import { ApiProperty } from '@nestjs/swagger';
|
|
||||||
|
|
||||||
export class RequestOtpDto {
|
|
||||||
@IsNotEmpty()
|
|
||||||
@IsString()
|
|
||||||
@ApiProperty({ example: '09362532122', description: 'Mobile number' })
|
|
||||||
@IsMobilePhone('fa-IR')
|
|
||||||
phone: string;
|
|
||||||
}
|
|
||||||
@@ -5,9 +5,6 @@ export class RequestOtpDto {
|
|||||||
@IsNotEmpty()
|
@IsNotEmpty()
|
||||||
@IsString()
|
@IsString()
|
||||||
@ApiProperty({ example: '09362532122', description: 'Mobile number' })
|
@ApiProperty({ example: '09362532122', description: 'Mobile number' })
|
||||||
// @Matches(/^09\d{9}$/, {
|
|
||||||
// message: 'Mobile number must be a valid Iranian phone number (e.g., 09123456789)',
|
|
||||||
// })
|
|
||||||
@IsMobilePhone('fa-IR')
|
@IsMobilePhone('fa-IR')
|
||||||
phone: string;
|
phone: string;
|
||||||
|
|
||||||
|
|||||||
+2
-5
@@ -1,14 +1,11 @@
|
|||||||
import { IsNotEmpty, IsString, Length, Matches } from 'class-validator';
|
import { IsNotEmpty, IsString, Length, IsMobilePhone } from 'class-validator';
|
||||||
import { ApiProperty } from '@nestjs/swagger';
|
import { ApiProperty } from '@nestjs/swagger';
|
||||||
|
|
||||||
export class VerifyOtpDto {
|
export class VerifyOtpDto {
|
||||||
@IsNotEmpty()
|
@IsNotEmpty()
|
||||||
@IsString()
|
@IsString()
|
||||||
@ApiProperty({ example: '09362532122', description: 'Mobile number' })
|
@ApiProperty({ example: '09362532122', description: 'Mobile number' })
|
||||||
@Matches(/^09\d{9}$/, {
|
@IsMobilePhone('fa-IR')
|
||||||
message: 'Mobile number must be a valid Iranian phone number (e.g., 09123456789)',
|
|
||||||
})
|
|
||||||
// @IsMobilePhone('fa-IR')
|
|
||||||
phone: string;
|
phone: string;
|
||||||
|
|
||||||
@IsNotEmpty()
|
@IsNotEmpty()
|
||||||
Reference in New Issue
Block a user