mirror of
https://gitlab.com/comunic/comunicmobile
synced 2025-06-19 08:15:16 +00:00
Can update comments content
This commit is contained in:
@ -37,13 +37,24 @@ class CommentsHelper {
|
||||
return apiToComment(response.getObject());
|
||||
}
|
||||
|
||||
/// Update comment content
|
||||
Future<bool> updateContent(int id, String newContent) async {
|
||||
return (await APIRequest(uri: "comments/edit", needLogin: true, args: {
|
||||
"commentID": id.toString(),
|
||||
"content": newContent,
|
||||
}).exec())
|
||||
.isOK;
|
||||
}
|
||||
|
||||
/// 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;
|
||||
uri: "comments/delete",
|
||||
needLogin: true,
|
||||
args: {"commentID": id.toString()},
|
||||
).exec())
|
||||
.code ==
|
||||
200;
|
||||
}
|
||||
|
||||
/// Turn an API entry into a [Comment] object
|
||||
|
Reference in New Issue
Block a user