This commit is contained in:
2026-02-05 11:24:20 +03:30
parent 38c64c4caa
commit fac601030c
4 changed files with 13 additions and 18 deletions
+4 -4
View File
@@ -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;
}