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

Can delete group

This commit is contained in:
2020-05-02 09:45:03 +02:00
parent 9646cb7a70
commit df111e393a
2 changed files with 49 additions and 1 deletions

View File

@ -238,11 +238,22 @@ class GroupsHelper {
.execWithFilesAndThrow();
/// Delete group logo
///
/// Throws in case of error
static Future<void> deleteLogo(int groupID) async =>
await APIRequest(uri: "groups/delete_logo", needLogin: true)
.addInt("id", groupID)
.execWithThrow();
/// Delete a group
///
/// Throws in case of error
static Future<void> deleteGroup(int groupID, String password) async =>
await APIRequest(uri: "groups/delete", needLogin: true)
.addInt("groupID", groupID)
.addString("password", password)
.execWithThrow();
/// Turn an API entry into a group object
Group _getGroupFromAPI(Map<String, dynamic> map) {
return Group(