mirror of
https://gitlab.com/comunic/comunicapiv2
synced 2024-11-22 13:29:22 +00:00
Done with another TODO
This commit is contained in:
parent
c945c6acda
commit
d9248593e9
@ -414,9 +414,7 @@ export class GroupsController {
|
|||||||
h.error(404, "Membership not found!");
|
h.error(404, "Membership not found!");
|
||||||
|
|
||||||
// If the user is an admin, he must not be the last admin of the group
|
// If the user is an admin, he must not be the last admin of the group
|
||||||
// TODO : use new method
|
if(userID == h.getUserId() && await GroupsHelper.IsLastAdmin(groupID, userID))
|
||||||
if(userID == h.getUserId() && currUserMembership.level == GroupMembershipLevels.ADMINISTRATOR
|
|
||||||
&& await GroupsHelper.CountMembersAtLevel(groupID, GroupMembershipLevels.ADMINISTRATOR) == 1)
|
|
||||||
h.error(401, "You are the last administrator of this group!");
|
h.error(401, "You are the last administrator of this group!");
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user