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

Can delete comments

This commit is contained in:
2019-05-18 16:48:19 +02:00
parent 55088f2b23
commit 6d73d38bf8
5 changed files with 64 additions and 5 deletions

View File

@ -37,6 +37,15 @@ class CommentsHelper {
return apiToComment(response.getObject());
}
/// Attempt to delete a comment
Future<bool> delete(int id) async {
return (await APIRequest(
uri: "comments/delete",
needLogin: true,
args: {"commentID": id.toString()},
).exec()).code == 200;
}
/// Turn an API entry into a [Comment] object
static Comment apiToComment(Map<String, dynamic> entry) {
return Comment(