fix bug in admin

This commit is contained in:
2026-02-26 09:29:16 +03:30
parent 7b8c6503f5
commit aa81da6477
2 changed files with 1 additions and 2 deletions
+1 -1
View File
@@ -86,7 +86,7 @@ export class AdminService {
} }
if (rest.phone !== undefined && rest.phone !== admin.phone) { if (rest.phone !== undefined && rest.phone !== admin.phone) {
const exists = await this.adminRepository.findOne({ phone: rest.phone }); const exists = await this.adminRepository.findOne({ phone: rest.phone,id: { $ne: adminId } });
if (exists) { if (exists) {
throw new ConflictException('This Phone Number is already taken'); throw new ConflictException('This Phone Number is already taken');
} }
@@ -1,7 +1,6 @@
import { Entity, Property, Unique, ManyToMany, Collection, PrimaryKey, Enum, OptionalProps } from '@mikro-orm/core'; import { Entity, Property, Unique, ManyToMany, Collection, PrimaryKey, Enum, OptionalProps } from '@mikro-orm/core';
import { BaseEntity } from '../../../common/entities/base.entity'; import { BaseEntity } from '../../../common/entities/base.entity';
import { Role } from './role.entity'; import { Role } from './role.entity';
import { ulid } from 'ulid';
import { PermissionEnum } from 'src/common/enums/permission.enum'; import { PermissionEnum } from 'src/common/enums/permission.enum';
@Entity({ tableName: 'permissions' }) @Entity({ tableName: 'permissions' })