fix bug in admin
This commit is contained in:
@@ -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' })
|
||||||
|
|||||||
Reference in New Issue
Block a user