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