mirror of
https://gitlab.com/comunic/comunicapiv3
synced 2025-06-21 00:45:18 +00:00
Can update the content of the posts
This commit is contained in:
@ -391,6 +391,14 @@ pub fn set_level(post_id: u64, level: PostVisibilityLevel) -> ResultBoxError {
|
||||
.exec()
|
||||
}
|
||||
|
||||
/// Set a new content to the post
|
||||
pub fn set_content(post_id: u64, new_content: &str) -> ResultBoxError {
|
||||
database::UpdateInfo::new(POSTS_TABLE)
|
||||
.cond_u64("ID", post_id)
|
||||
.set_str("texte", new_content)
|
||||
.exec()
|
||||
}
|
||||
|
||||
/// Turn a post into a database entry
|
||||
fn db_to_post(res: &database::RowResult) -> ResultBoxError<Post> {
|
||||
let user_id = if res.get_u64("ID_amis")? == 0 {
|
||||
|
Reference in New Issue
Block a user