mirror of
https://gitlab.com/comunic/comunicapiv3
synced 2025-09-19 11:28:46 +00:00
Can get information about a single post
This commit is contained in:
@@ -230,6 +230,13 @@ pub fn get_latest(query: &PostsQuery, include_group_posts: bool) -> ResultBoxErr
|
||||
.exec(db_to_post)
|
||||
}
|
||||
|
||||
/// Get information about a single post
|
||||
pub fn get_single(post_id: u64) -> ResultBoxError<Post> {
|
||||
database::QueryInfo::new(POSTS_TABLE)
|
||||
.cond_u64("ID", post_id)
|
||||
.query_row(db_to_post)
|
||||
}
|
||||
|
||||
/// Get the access level of a user over a post
|
||||
pub fn get_access_level(p: &Post, user_id: &Option<UserID>) -> ResultBoxError<PostAccessLevel> {
|
||||
if user_id == &p.user_id.as_option() {
|
||||
|
Reference in New Issue
Block a user