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

Can delete posts

This commit is contained in:
2019-05-19 14:54:09 +02:00
parent d3f5fb6c28
commit 1fbe59c83c
4 changed files with 85 additions and 25 deletions

View File

@ -56,6 +56,16 @@ class PostsHelper {
}
}
/// Delete a post
Future<bool> delete(int id) async {
return (await APIRequest(
uri: "posts/delete",
needLogin: true,
args: {"postID": id.toString()},
).exec())
.isOK;
}
/// Turn an API entry into a [Post] object
Post _apiToPost(Map<String, dynamic> map) {
// Parse comments