saved_only,
local_user: local_user_view.as_ref(),
community_id,
- is_profile_view: Some(true),
+ is_profile_view: true,
page,
limit,
creator_id,
.await?;
let comments = CommentQuery {
- local_user: (local_user_view.as_ref()),
- sort: (sort.map(post_to_comment_sort_type)),
- saved_only: (saved_only),
- show_deleted_and_removed: (Some(false)),
- community_id: (community_id),
- is_profile_view: Some(true),
- page: (page),
- limit: (limit),
+ local_user: local_user_view.as_ref(),
+ sort: sort.map(post_to_comment_sort_type),
+ saved_only,
+ community_id,
+ is_profile_view: true,
+ page,
+ limit,
creator_id,
..Default::default()
}
query = query.filter(comment_saved::comment_id.is_not_null());
}
- let is_profile_view = options.is_profile_view.unwrap_or(false);
let is_creator = options.creator_id == options.local_user.map(|l| l.person.id);
// only show deleted comments to creator
if !is_creator {
let is_admin = options.local_user.map(|l| l.person.admin).unwrap_or(false);
// only show removed comments to admin when viewing user profile
- if !(is_profile_view && is_admin) {
+ if !(options.is_profile_view && is_admin) {
query = query.filter(comment::removed.eq(false));
}
pub local_user: Option<&'a LocalUserView>,
pub search_term: Option<String>,
pub saved_only: Option<bool>,
- pub is_profile_view: Option<bool>,
- pub show_deleted_and_removed: Option<bool>,
+ pub is_profile_view: bool,
pub page: Option<i64>,
pub limit: Option<i64>,
pub max_depth: Option<i32>,
)
.select(selection);
- let is_profile_view = options.is_profile_view.unwrap_or(false);
let is_creator = options.creator_id == options.local_user.map(|l| l.person.id);
// only show deleted posts to creator
if is_creator {
let is_admin = options.local_user.map(|l| l.person.admin).unwrap_or(false);
// only show removed posts to admin when viewing user profile
- if !(is_profile_view && is_admin) {
+ if !(options.is_profile_view && is_admin) {
query = query
.filter(community::removed.eq(false))
.filter(post::removed.eq(false));
pub url_search: Option<String>,
pub saved_only: Option<bool>,
pub moderator_view: Option<bool>,
- pub is_profile_view: Option<bool>,
+ pub is_profile_view: bool,
pub page: Option<i64>,
pub limit: Option<i64>,
}
let post_listings_is_admin = PostQuery {
sort: Some(SortType::New),
local_user: Some(&data.local_user_view),
- is_profile_view: Some(true),
+ is_profile_view: true,
..Default::default()
}
.list(pool)