1 use lemmy_db_schema::{newtypes::CommunityId, source::local_site::LocalSite, ListingType};
2 use lemmy_utils::error::LemmyError;
6 pub mod read_community;
8 pub mod resolve_object;
11 /// Returns default listing type, depending if the query is for frontpage or community.
12 fn listing_type_with_default(
13 type_: Option<ListingType>,
14 local_site: &LocalSite,
15 community_id: Option<CommunityId>,
16 ) -> Result<ListingType, LemmyError> {
17 // On frontpage use listing type from param or admin configured default
18 let listing_type = if community_id.is_none() {
19 type_.unwrap_or(local_site.default_post_listing_type)
21 // inside of community show everything