mirror of
https://gitlab.com/comunic/comunicmobile
synced 2025-06-19 00:05:16 +00:00
Can upload a new logo for the group
This commit is contained in:
@ -1,3 +1,5 @@
|
||||
import 'dart:typed_data';
|
||||
|
||||
import 'package:comunic/lists/groups_list.dart';
|
||||
import 'package:comunic/models/advanced_group_info.dart';
|
||||
import 'package:comunic/models/api_request.dart';
|
||||
@ -226,6 +228,15 @@ class GroupsHelper {
|
||||
.execWithThrow();
|
||||
}
|
||||
|
||||
/// Upload a new logo
|
||||
///
|
||||
/// Throws in case of failure
|
||||
static Future<void> uploadNewLogo(int groupID, Uint8List bytes) async =>
|
||||
await APIRequest(uri: "groups/upload_logo", needLogin: true)
|
||||
.addInt("id", groupID)
|
||||
.addBytesFile("logo", BytesFile("logo.png", bytes))
|
||||
.execWithFilesAndThrow();
|
||||
|
||||
/// Turn an API entry into a group object
|
||||
Group _getGroupFromAPI(Map<String, dynamic> map) {
|
||||
return Group(
|
||||
|
Reference in New Issue
Block a user