]> Untitled Git - lemmy.git/commit
Fix listing type default value (#2796)
authorNutomic <me@nutomic.com>
Wed, 12 Apr 2023 14:40:59 +0000 (16:40 +0200)
committerGitHub <noreply@github.com>
Wed, 12 Apr 2023 14:40:59 +0000 (10:40 -0400)
commit9d26ac2c6ff4e7e21178ba27cd04f1e558c8d99b
treea3203726e56f5142978d3e55e95bd7eb877dfad1
parentd18bc95b7b92c99bd029604ed7797575f54e6dd4
Fix listing type default value (#2796)

* Fix listing type default value

The listing type parameter is only meant for the frontpage, but is
also applied inside of communities. The result is that this call
returns nothing, because it defaults to ListingType::Local:
https://fedibb.ml/api/v3/post/list?community_id=3

It needs to be called like this to get any posts:
https://fedibb.ml/api/v3/post/list?community_id=3&type_=All

This is clearly not expected behaviour, when a community is
specified, the listing type should default to All.

* fix clippy
crates/api_common/src/utils.rs
crates/apub/src/api/list_comments.rs
crates/apub/src/api/list_posts.rs
crates/apub/src/api/mod.rs
crates/apub/src/api/search.rs
crates/db_views/src/comment_view.rs
crates/db_views/src/post_view.rs