1
0
mirror of https://gitlab.com/comunic/comunicmobile synced 2025-06-19 00:05:16 +00:00

Can change group membership levels

This commit is contained in:
2020-05-02 17:26:03 +02:00
parent eb66ea407b
commit 685565e031
3 changed files with 55 additions and 5 deletions

View File

@ -306,6 +306,17 @@ class GroupsHelper {
.addInt("userID", userID)
.execWithThrow();
/// Change the membership level of a member of a group
///
/// Throws an exception in case of failure
static Future<void> setNewLevel(
int groupID, int userID, GroupMembershipLevel level) async =>
await APIRequest.withLogin("groups/update_membership_level")
.addInt("groupID", groupID)
.addInt("userID", userID)
.addString("level", invertMap(_APIGroupsMembershipLevelsMap)[level])
.execWithThrow();
/// Turn an API entry into a group object
Group _getGroupFromAPI(Map<String, dynamic> map) {
return Group(