mirror of
https://github.com/LemmyNet/lemmy.git
synced 2024-12-25 17:30:33 +00:00
Merge pull request #1517 from LemmyNet/add_saved_only_1
Adding saved_only to GetComments and GetPosts. Fixes #1513
This commit is contained in:
commit
3949b35360
5 changed files with 8 additions and 0 deletions
|
@ -690,12 +690,14 @@ impl Perform for GetComments {
|
||||||
|
|
||||||
let community_id = data.community_id;
|
let community_id = data.community_id;
|
||||||
let community_name = data.community_name.to_owned();
|
let community_name = data.community_name.to_owned();
|
||||||
|
let saved_only = data.saved_only;
|
||||||
let page = data.page;
|
let page = data.page;
|
||||||
let limit = data.limit;
|
let limit = data.limit;
|
||||||
let comments = blocking(context.pool(), move |conn| {
|
let comments = blocking(context.pool(), move |conn| {
|
||||||
CommentQueryBuilder::create(conn)
|
CommentQueryBuilder::create(conn)
|
||||||
.listing_type(type_)
|
.listing_type(type_)
|
||||||
.sort(&sort)
|
.sort(&sort)
|
||||||
|
.saved_only(saved_only)
|
||||||
.community_id(community_id)
|
.community_id(community_id)
|
||||||
.community_name(community_name)
|
.community_name(community_name)
|
||||||
.my_person_id(person_id)
|
.my_person_id(person_id)
|
||||||
|
|
|
@ -596,6 +596,7 @@ impl Perform for GetPersonDetails {
|
||||||
.my_person_id(person_id)
|
.my_person_id(person_id)
|
||||||
.sort(&sort)
|
.sort(&sort)
|
||||||
.saved_only(saved_only)
|
.saved_only(saved_only)
|
||||||
|
.community_id(community_id)
|
||||||
.page(page)
|
.page(page)
|
||||||
.limit(limit);
|
.limit(limit);
|
||||||
|
|
||||||
|
|
|
@ -260,6 +260,8 @@ impl Perform for GetPosts {
|
||||||
let limit = data.limit;
|
let limit = data.limit;
|
||||||
let community_id = data.community_id;
|
let community_id = data.community_id;
|
||||||
let community_name = data.community_name.to_owned();
|
let community_name = data.community_name.to_owned();
|
||||||
|
let saved_only = data.saved_only;
|
||||||
|
|
||||||
let posts = match blocking(context.pool(), move |conn| {
|
let posts = match blocking(context.pool(), move |conn| {
|
||||||
PostQueryBuilder::create(conn)
|
PostQueryBuilder::create(conn)
|
||||||
.listing_type(&type_)
|
.listing_type(&type_)
|
||||||
|
@ -267,6 +269,7 @@ impl Perform for GetPosts {
|
||||||
.show_nsfw(show_nsfw)
|
.show_nsfw(show_nsfw)
|
||||||
.community_id(community_id)
|
.community_id(community_id)
|
||||||
.community_name(community_name)
|
.community_name(community_name)
|
||||||
|
.saved_only(saved_only)
|
||||||
.my_person_id(person_id)
|
.my_person_id(person_id)
|
||||||
.page(page)
|
.page(page)
|
||||||
.limit(limit)
|
.limit(limit)
|
||||||
|
|
|
@ -70,6 +70,7 @@ pub struct GetComments {
|
||||||
pub limit: Option<i64>,
|
pub limit: Option<i64>,
|
||||||
pub community_id: Option<CommunityId>,
|
pub community_id: Option<CommunityId>,
|
||||||
pub community_name: Option<String>,
|
pub community_name: Option<String>,
|
||||||
|
pub saved_only: bool,
|
||||||
pub auth: Option<String>,
|
pub auth: Option<String>,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -49,6 +49,7 @@ pub struct GetPosts {
|
||||||
pub limit: Option<i64>,
|
pub limit: Option<i64>,
|
||||||
pub community_id: Option<CommunityId>,
|
pub community_id: Option<CommunityId>,
|
||||||
pub community_name: Option<String>,
|
pub community_name: Option<String>,
|
||||||
|
pub saved_only: bool,
|
||||||
pub auth: Option<String>,
|
pub auth: Option<String>,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue