mirror of
https://gitlab.com/comunic/comunicapiv3
synced 2025-06-20 16:35:17 +00:00
Can determine post access level
This commit is contained in:
@ -8,7 +8,7 @@ use crate::api_data::survey_api::SurveyAPI;
|
||||
use crate::data::error::ResultBoxError;
|
||||
use crate::data::post::{Post, PostKind};
|
||||
use crate::data::user::UserID;
|
||||
use crate::helpers::{likes_helper, movies_helper, survey_helper};
|
||||
use crate::helpers::{likes_helper, movies_helper, survey_helper, posts_helper};
|
||||
use crate::helpers::likes_helper::LikeType;
|
||||
use crate::utils::user_data_utils::user_data_url;
|
||||
|
||||
@ -22,6 +22,7 @@ pub struct PostAPI {
|
||||
post_time: u64,
|
||||
content: Option<String>,
|
||||
visibility_level: String,
|
||||
user_access: String,
|
||||
kind: String,
|
||||
|
||||
// File specific
|
||||
@ -62,6 +63,7 @@ impl PostAPI {
|
||||
post_time: p.time_create,
|
||||
content: p.content.clone(),
|
||||
visibility_level: p.visibility.to_api(),
|
||||
user_access: posts_helper::get_access_level(&p, user)?.to_api(),
|
||||
kind: p.kind.to_api(),
|
||||
|
||||
// File specific
|
||||
|
Reference in New Issue
Block a user