1
0
mirror of https://gitlab.com/comunic/comunicapiv3 synced 2025-06-21 00:45:18 +00:00

Can update comment content

This commit is contained in:
2020-07-10 08:57:46 +02:00
parent 24e094fc4a
commit 5a5bf8c5c3
5 changed files with 41 additions and 6 deletions

View File

@ -53,6 +53,14 @@ fn db_to_comment(row: &database::RowResult) -> ResultBoxError<Comment> {
})
}
/// Update comment content
pub fn edit(comment_id: u64, new_content: &str) -> ResultBoxError {
database::UpdateInfo::new(COMMENTS_TABLE)
.cond_u64("ID", comment_id)
.set_str("commentaire", new_content)
.exec()
}
/// Delete a single comment
pub fn delete(c: &Comment) -> ResultBoxError {
// Delete associated image (if any)