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

Show newly created comment

This commit is contained in:
2019-05-18 15:05:26 +02:00
parent 1f899f7594
commit 754745fd5f
2 changed files with 25 additions and 1 deletions

View File

@ -25,6 +25,18 @@ class CommentsHelper {
return response.getObject()["commentID"];
}
/// Get a single comment from the server, specified by its [id]
Future<Comment> getSingle(int id) async {
final response = await APIRequest(
uri: "comments/get_single",
needLogin: true,
args: {"commentID": id.toString()}).exec();
if (response.code != 200) return null;
return apiToComment(response.getObject());
}
/// Turn an API entry into a [Comment] object
static Comment apiToComment(Map<String, dynamic> entry) {
return Comment(