X-Git-Url: http://these/git/?a=blobdiff_plain;f=crates%2Fapub%2Fsrc%2Fapi%2Flist_posts.rs;h=c43e1381e7fb5d54d2d5e40fb288b18dda7a9949;hb=c8063f3267cf2b3622f1fdc69128c6b55feefbbc;hp=2ebd6b766a29a842eeaa922cce356f0bcbc102e1;hpb=047db9ac8590670538129b5f765f47e7c66a8a80;p=lemmy.git diff --git a/crates/apub/src/api/list_posts.rs b/crates/apub/src/api/list_posts.rs index 2ebd6b76..c43e1381 100644 --- a/crates/apub/src/api/list_posts.rs +++ b/crates/apub/src/api/list_posts.rs @@ -34,7 +34,15 @@ pub async fn list_posts( } else { data.community_id }; - let saved_only = data.saved_only; + let saved_only = data.saved_only.unwrap_or_default(); + + let liked_only = data.liked_only.unwrap_or_default(); + let disliked_only = data.disliked_only.unwrap_or_default(); + if liked_only && disliked_only { + return Err(LemmyError::from(LemmyErrorType::ContradictingFilters)); + } + + let moderator_view = data.moderator_view.unwrap_or_default(); let listing_type = Some(listing_type_with_default( data.type_, @@ -48,6 +56,9 @@ pub async fn list_posts( sort, community_id, saved_only, + liked_only, + disliked_only, + moderator_view, page, limit, ..Default::default()