From 414f7e179f1cb2d0156ba4683b7296423ebdea1e Mon Sep 17 00:00:00 2001 From: morteza-mortezai Date: Mon, 24 Nov 2025 19:21:18 +0330 Subject: [PATCH] update --- src/modules/auth/controllers/admin-auth.controller.ts | 2 +- src/modules/auth/controllers/auth.controller.ts | 2 +- src/modules/auth/dto/request-otp-admin.dto.ts | 10 ---------- src/modules/auth/dto/request-otp.dto.ts | 3 --- .../dto/{verify-otp.dto copy.ts => verify-otp.dto.ts} | 7 ++----- 5 files changed, 4 insertions(+), 20 deletions(-) delete mode 100644 src/modules/auth/dto/request-otp-admin.dto.ts rename src/modules/auth/dto/{verify-otp.dto copy.ts => verify-otp.dto.ts} (65%) diff --git a/src/modules/auth/controllers/admin-auth.controller.ts b/src/modules/auth/controllers/admin-auth.controller.ts index 5f2ad65..d852db4 100644 --- a/src/modules/auth/controllers/admin-auth.controller.ts +++ b/src/modules/auth/controllers/admin-auth.controller.ts @@ -2,7 +2,7 @@ import { Controller, Post, Body } from '@nestjs/common'; import { AuthService } from '../services/auth.service'; import { RequestOtpDto } from '../dto/request-otp.dto'; 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 { RefreshTokenRateLimit } from 'src/common/decorators/rate-limit.decorator'; import { RefreshTokenDto } from '../dto/refresh-token.dto'; diff --git a/src/modules/auth/controllers/auth.controller.ts b/src/modules/auth/controllers/auth.controller.ts index c294097..8d63297 100644 --- a/src/modules/auth/controllers/auth.controller.ts +++ b/src/modules/auth/controllers/auth.controller.ts @@ -2,7 +2,7 @@ import { Controller, Post, Body } from '@nestjs/common'; import { AuthService } from '../services/auth.service'; import { RequestOtpDto } from '../dto/request-otp.dto'; 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 { RefreshTokenRateLimit } from 'src/common/decorators/rate-limit.decorator'; import { RefreshTokenDto } from '../dto/refresh-token.dto'; diff --git a/src/modules/auth/dto/request-otp-admin.dto.ts b/src/modules/auth/dto/request-otp-admin.dto.ts deleted file mode 100644 index 8ffba53..0000000 --- a/src/modules/auth/dto/request-otp-admin.dto.ts +++ /dev/null @@ -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; -} diff --git a/src/modules/auth/dto/request-otp.dto.ts b/src/modules/auth/dto/request-otp.dto.ts index e2991b9..83984af 100644 --- a/src/modules/auth/dto/request-otp.dto.ts +++ b/src/modules/auth/dto/request-otp.dto.ts @@ -5,9 +5,6 @@ export class RequestOtpDto { @IsNotEmpty() @IsString() @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') phone: string; diff --git a/src/modules/auth/dto/verify-otp.dto copy.ts b/src/modules/auth/dto/verify-otp.dto.ts similarity index 65% rename from src/modules/auth/dto/verify-otp.dto copy.ts rename to src/modules/auth/dto/verify-otp.dto.ts index d8de696..ec1c6f1 100644 --- a/src/modules/auth/dto/verify-otp.dto copy.ts +++ b/src/modules/auth/dto/verify-otp.dto.ts @@ -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'; export class VerifyOtpDto { @IsNotEmpty() @IsString() @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; @IsNotEmpty()