]> Untitled Git - lemmy.git/commitdiff
Adding saved_only to GetComments and GetPosts. Fixes #1513
authorDessalines <tyhou13@gmx.com>
Mon, 22 Mar 2021 14:39:54 +0000 (10:39 -0400)
committerDessalines <tyhou13@gmx.com>
Mon, 22 Mar 2021 14:39:54 +0000 (10:39 -0400)
crates/api/src/comment.rs
crates/api/src/local_user.rs
crates/api/src/post.rs
crates/api_structs/src/comment.rs
crates/api_structs/src/post.rs

index 4fd3f7b2c2ddbba4dd1fca52d3f3f1d45c9a89d7..bcee72b0942a45dcb7224b6881df1401c614f01c 100644 (file)
@@ -690,12 +690,14 @@ impl Perform for GetComments {
 
     let community_id = data.community_id;
     let community_name = data.community_name.to_owned();
+    let saved_only = data.saved_only;
     let page = data.page;
     let limit = data.limit;
     let comments = blocking(context.pool(), move |conn| {
       CommentQueryBuilder::create(conn)
         .listing_type(type_)
         .sort(&sort)
+        .saved_only(saved_only)
         .community_id(community_id)
         .community_name(community_name)
         .my_person_id(person_id)
index 266d28eecb10f2bf5789e066321cead3af72f25c..6aa8b26c96faa4c24563e67e19f52ac4f56a2fc9 100644 (file)
@@ -596,6 +596,7 @@ impl Perform for GetPersonDetails {
         .my_person_id(person_id)
         .sort(&sort)
         .saved_only(saved_only)
+        .community_id(community_id)
         .page(page)
         .limit(limit);
 
index 9911f6722c551c701a1e487156eaccf00ed55b68..bbc3e04bb0e9497e7fd4bc74bbacee908042c7b1 100644 (file)
@@ -260,6 +260,8 @@ impl Perform for GetPosts {
     let limit = data.limit;
     let community_id = data.community_id;
     let community_name = data.community_name.to_owned();
+    let saved_only = data.saved_only;
+
     let posts = match blocking(context.pool(), move |conn| {
       PostQueryBuilder::create(conn)
         .listing_type(&type_)
@@ -267,6 +269,7 @@ impl Perform for GetPosts {
         .show_nsfw(show_nsfw)
         .community_id(community_id)
         .community_name(community_name)
+        .saved_only(saved_only)
         .my_person_id(person_id)
         .page(page)
         .limit(limit)
index f62c41aa461e3e267ad2245ba90f0b7553e70840..1457f181a5203d907bd39f349efb2d54b149e084 100644 (file)
@@ -70,6 +70,7 @@ pub struct GetComments {
   pub limit: Option<i64>,
   pub community_id: Option<CommunityId>,
   pub community_name: Option<String>,
+  pub saved_only: bool,
   pub auth: Option<String>,
 }
 
index d0991166758f18236a39d8b882b68530278ef8ee..727859bc4cc7c7db55d034cfd851a81b66af572a 100644 (file)
@@ -49,6 +49,7 @@ pub struct GetPosts {
   pub limit: Option<i64>,
   pub community_id: Option<CommunityId>,
   pub community_name: Option<String>,
+  pub saved_only: bool,
   pub auth: Option<String>,
 }