chore: add new structure for the ticket assinge to admins
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user