chore: add new structure for the ticket assinge to admins

This commit is contained in:
mahyargdz
2025-04-04 14:22:35 +03:30
parent 0b62341908
commit 0bc001c66b
10 changed files with 185 additions and 34 deletions
@@ -337,6 +337,11 @@ export class UsersService {
}
/************************************************************ */
async getSuperAdmin() {
const superAdmin = await this.userRepository.findOne({ where: { roles: { name: RoleEnum.SUPER_ADMIN } }, relations: { roles: true } });
return superAdmin;
}
async isSuperAdmin(adminId: string) {
const user = await this.userRepository.findOne({ where: { id: adminId }, relations: { roles: true } });
if (!user) throw new BadRequestException(UserMessage.USER_NOT_FOUND);