mirror of
https://github.com/SyncrowIOT/backend.git
synced 2025-07-16 18:56:22 +00:00
added default region in otp
This commit is contained in:
@ -1,6 +1,12 @@
|
|||||||
import { OtpType } from '../../../libs/common/src/constants/otp-type.enum';
|
import { OtpType } from '../../../libs/common/src/constants/otp-type.enum';
|
||||||
import { ApiProperty } from '@nestjs/swagger';
|
import { ApiProperty } from '@nestjs/swagger';
|
||||||
import { IsEmail, IsEnum, IsNotEmpty, IsString } from 'class-validator';
|
import {
|
||||||
|
IsEmail,
|
||||||
|
IsEnum,
|
||||||
|
IsNotEmpty,
|
||||||
|
IsOptional,
|
||||||
|
IsString,
|
||||||
|
} from 'class-validator';
|
||||||
|
|
||||||
export class UserOtpDto {
|
export class UserOtpDto {
|
||||||
@ApiProperty()
|
@ApiProperty()
|
||||||
@ -14,9 +20,9 @@ export class UserOtpDto {
|
|||||||
type: OtpType;
|
type: OtpType;
|
||||||
|
|
||||||
@ApiProperty()
|
@ApiProperty()
|
||||||
@IsNotEmpty()
|
@IsOptional()
|
||||||
@IsString()
|
@IsString()
|
||||||
regionName: string;
|
regionUuid?: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
export class VerifyOtpDto extends UserOtpDto {
|
export class VerifyOtpDto extends UserOtpDto {
|
||||||
|
@ -130,9 +130,13 @@ export class UserAuthService {
|
|||||||
threeDaysAgo.setDate(threeDaysAgo.getDate() - 3);
|
threeDaysAgo.setDate(threeDaysAgo.getDate() - 3);
|
||||||
const userExists = await this.userRepository.exists({
|
const userExists = await this.userRepository.exists({
|
||||||
where: {
|
where: {
|
||||||
region: {
|
region: data.regionUuid
|
||||||
regionName: data.regionName,
|
? {
|
||||||
},
|
uuid: data.regionUuid,
|
||||||
|
}
|
||||||
|
: {
|
||||||
|
regionName: 'United Arab Emirates',
|
||||||
|
},
|
||||||
email: data.email,
|
email: data.email,
|
||||||
isUserVerified: true,
|
isUserVerified: true,
|
||||||
},
|
},
|
||||||
|
Reference in New Issue
Block a user