use lemmy_api_common::context::LemmyContext;
use lemmy_db_schema::{newtypes::CommunityId, source::local_site::LocalSite, ListingType};
use lemmy_utils::{error::LemmyError, ConnectionId};
-use std::str::FromStr;
mod list_comments;
mod list_posts;
) -> Result<ListingType, LemmyError> {
// On frontpage use listing type from param or admin configured default
let listing_type = if community_id.is_none() {
- type_.unwrap_or(ListingType::from_str(
- &local_site.default_post_listing_type,
- )?)
+ type_.unwrap_or(local_site.default_post_listing_type)
} else {
// inside of community show everything
ListingType::All