1
0
mirror of https://gitlab.com/comunic/comunicapiv2 synced 2025-07-17 15:18:05 +00:00

Can delete a member of a group

This commit is contained in:
2019-12-27 10:28:43 +01:00
parent 3be2b8d90f
commit d44ad71510
3 changed files with 54 additions and 0 deletions

@ -405,6 +405,21 @@ export class GroupsHelper {
});
}
/**
* Count the number of members of a group at a specific member
* @param groupID Target group ID
* @param level The level to check
*/
public static async CountMembersAtLevel(groupID: number, level: GroupMembershipLevels) : Promise<number> {
return await DatabaseHelper.Count({
table: GROUPS_MEMBERS_TABLE,
where: {
groups_id: groupID,
level: level
}
});
}
/**
* Turn a database row into a {GroupInfo} object
*