diff options
author | Lyra <teromene@teromene.fr> | 2019-12-07 23:54:42 +0100 |
---|---|---|
committer | Lyra <teromene@teromene.fr> | 2019-12-07 23:54:42 +0100 |
commit | 9fc8aacc2d96cce358d98bd3989c0db4785f3512 (patch) | |
tree | 42da4491c67e9b13744b8586f8fd7459e96c6758 /server/src/api/post.rs | |
parent | 3123d308d092232dc7c099b4285fab94b9cc8dbc (diff) |
Add default options for all parameters and move them out of the constructor. Rename structure to PostQueryBuilder
Diffstat (limited to 'server/src/api/post.rs')
-rw-r--r-- | server/src/api/post.rs | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/server/src/api/post.rs b/server/src/api/post.rs index e507aba3..e1c9b778 100644 --- a/server/src/api/post.rs +++ b/server/src/api/post.rs @@ -238,7 +238,10 @@ impl Perform<GetPostsResponse> for Oper<GetPosts> { let type_ = ListingType::from_str(&data.type_)?; let sort = SortType::from_str(&data.sort)?; - let posts = match PostViewQuery::create(&conn, type_, &sort, show_nsfw, false, false) + let posts = match PostQueryBuilder::create(&conn) + .listing_type(type_) + .sort(&sort) + .show_nsfw(show_nsfw) .for_community_id_optional(data.community_id) .my_user_id_optional(user_id) .page_optional(data.page) |