1
0
mirror of https://gitlab.com/comunic/comunicapiv3 synced 2025-06-22 01:15:16 +00:00

Can get the list of members of a group

This commit is contained in:
2020-06-27 07:23:38 +02:00
parent ef532f5900
commit d7608ec974
4 changed files with 47 additions and 2 deletions

View File

@ -324,6 +324,13 @@ pub fn delete_logo(g: &GroupID) -> ResultBoxError {
set_logo_path(g, None)
}
/// Get the list of memberships of a group
pub fn get_list_members(g: &GroupID) -> ResultBoxError<Vec<GroupMember>> {
database::QueryInfo::new(GROUPS_MEMBERS_TABLE)
.cond_group_id("groups_id", g)
.exec(db_to_group_member)
}
/// Turn a database entry into a group struct
fn db_to_group(row: &database::RowResult) -> ResultBoxError<Group> {
let group_id = row.get_group_id("id")?;