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:
@ -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(
|
||||
|
Reference in New Issue
Block a user