mirror of
https://gitlab.com/comunic/comunicapiv3
synced 2025-06-22 01:15:16 +00:00
Can get information about a single comment
This commit is contained in:
@ -33,6 +33,13 @@ pub fn get(post_id: u64) -> ResultBoxError<Vec<Comment>> {
|
||||
.exec(db_to_comment)
|
||||
}
|
||||
|
||||
/// Get information about a single comment
|
||||
pub fn get_single(comment_id: u64) -> ResultBoxError<Comment> {
|
||||
database::QueryInfo::new(COMMENTS_TABLE)
|
||||
.cond_u64("ID", comment_id)
|
||||
.query_row(db_to_comment)
|
||||
}
|
||||
|
||||
|
||||
/// Turn a database entry into a comment object
|
||||
fn db_to_comment(row: &database::RowResult) -> ResultBoxError<Comment> {
|
||||
|
Reference in New Issue
Block a user