- };
-
- // You don't need to return settings for the user, since this comes back with GetSite
- // `my_user`
- let person_view = PersonView::read(context.pool(), person_details_id).await?;
-
- let sort = data.sort;
- let page = data.page;
- let limit = data.limit;
- let saved_only = data.saved_only;
- let community_id = data.community_id;
- let local_user = local_user_view.map(|l| l.local_user);
- let local_user_clone = local_user.clone();
-
- let posts_query = PostQuery::builder()
- .pool(context.pool())
- .sort(sort)
- .saved_only(saved_only)
- .local_user(local_user.as_ref())
- .community_id(community_id)
- .is_mod_or_admin(is_admin)
- .page(page)
- .limit(limit);
-
- // If its saved only, you don't care what creator it was
- // Or, if its not saved, then you only want it for that specific creator
- let posts = if !saved_only.unwrap_or(false) {
- posts_query
- .creator_id(Some(person_details_id))
- .build()
- .list()
- } else {
- posts_query.build().list()