mirror of
https://github.com/ToolJet/ToolJet
synced 2026-05-23 08:58:26 +00:00
user role fix
This commit is contained in:
parent
f1827722ab
commit
8a4600803a
1 changed files with 2 additions and 2 deletions
|
|
@ -98,8 +98,8 @@ export class UserRoleService {
|
|||
const admins = groupUsers
|
||||
.map((group) => group.user)
|
||||
.filter((user) => user.organizationUsers[0].status === USER_STATUS.ACTIVE);
|
||||
|
||||
if (admins.length < 2)
|
||||
const isAdmin = admins.find((admin) => admin.id === userId);
|
||||
if (isAdmin && admins.length < 2)
|
||||
throw new BadRequestException({
|
||||
message: {
|
||||
error: ERROR_HANDLER.EDITING_LAST_ADMIN_ROLE_NOT_ALLOWED,
|
||||
|
|
|
|||
Loading…
Reference in a new issue