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

Can create a group

This commit is contained in:
2020-05-02 18:15:55 +02:00
parent a48e7f57a6
commit d4a39a3527
3 changed files with 79 additions and 35 deletions

View File

@ -126,6 +126,17 @@ class GroupsHelper {
.map((f) => cast<int>(f))
.toSet();
/// Create a new group
///
/// Throws in case of failure
static Future<int> create(String name) async {
final result = await APIRequest.withLogin("groups/create")
.addString("name", name)
.execWithThrow();
return result.getObject()["id"];
}
/// Perform a simple membership request
Future<bool> _simpleMembershipRequest(int groupID, String uri,
{Map<String, String> args}) async =>