admin
This commit is contained in:
@@ -25,14 +25,14 @@ export class AdminService {
|
||||
|
||||
const currentAdmin = await this.adminRepository.findOne({
|
||||
phone: normalizedPhone,
|
||||
});
|
||||
}, { filters: { notDeleted: false } });
|
||||
|
||||
if (currentAdmin && !currentAdmin.deletedAt) {
|
||||
throw new BadRequestException('This phone number is already used');
|
||||
}
|
||||
|
||||
//TODO : test admins that were delted
|
||||
// re-register deleted admin
|
||||
|
||||
// retrieve deleted admin
|
||||
if (currentAdmin && currentAdmin.deletedAt) {
|
||||
currentAdmin.deletedAt = undefined
|
||||
await this.em.flush()
|
||||
@@ -74,7 +74,7 @@ export class AdminService {
|
||||
async findById(adminId: string): Promise<Admin | null> {
|
||||
const admin = await this.adminRepository.findOne(
|
||||
{ id: adminId },
|
||||
{ populate: ['role'] },
|
||||
{ populate: ['role', 'role.permissions'] },
|
||||
);
|
||||
return admin;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user