mirror of
				https://gitlab.com/comunic/comunicapiv3
				synced 2025-11-04 01:24:04 +00:00 
			
		
		
		
	Can update comment content
This commit is contained in:
		@@ -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)
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user