]> Untitled Git - lemmy.git/commitdiff
Fix *All* reports not showing. Fixes #2902 (#2903)
authorDessalines <dessalines@users.noreply.github.com>
Tue, 6 Jun 2023 09:01:48 +0000 (05:01 -0400)
committerGitHub <noreply@github.com>
Tue, 6 Jun 2023 09:01:48 +0000 (11:01 +0200)
* Fix *All* reports not showing. Fixes #2902

* Fix *All* reports not showing. Fixes #2902

* Fixing tests.

crates/db_views/src/comment_report_view.rs
crates/db_views/src/post_report_view.rs
crates/db_views/src/private_message_report_view.rs

index a5b8d71d4cb3f4ff870daed129abf11396fde54d..8d4ae54ee51626bc572ec39e7adc3ed6d191b517 100644 (file)
@@ -208,7 +208,7 @@ impl<'a> CommentReportQuery<'a> {
       query = query.filter(post::community_id.eq(community_id));
     }
 
-    if self.unresolved_only.unwrap_or(true) {
+    if self.unresolved_only.unwrap_or(false) {
       query = query.filter(comment_report::resolved.eq(false));
     }
 
@@ -592,6 +592,7 @@ mod tests {
       .pool(pool)
       .my_person_id(inserted_timmy.id)
       .admin(false)
+      .unresolved_only(Some(true))
       .build()
       .list()
       .await
index 29136a351b1147fb005c63a3a0d39baab9b2eaf2..14a91fc2da1bca27a7b39f7bc9961675fcdc931c 100644 (file)
@@ -219,7 +219,7 @@ impl<'a> PostReportQuery<'a> {
       query = query.filter(post::community_id.eq(community_id));
     }
 
-    if self.unresolved_only.unwrap_or(true) {
+    if self.unresolved_only.unwrap_or(false) {
       query = query.filter(post_report::resolved.eq(false));
     }
 
@@ -581,6 +581,7 @@ mod tests {
       .pool(pool)
       .my_person_id(inserted_timmy.id)
       .admin(false)
+      .unresolved_only(Some(true))
       .build()
       .list()
       .await
index ace9a5daa2f7334bc7ec0b564587c28b8cad3898..2bcad6f83828ac03ae47da5b8397d083e12dd99a 100644 (file)
@@ -112,7 +112,7 @@ impl<'a> PrivateMessageReportQuery<'a> {
       ))
       .into_boxed();
 
-    if self.unresolved_only.unwrap_or(true) {
+    if self.unresolved_only.unwrap_or(false) {
       query = query.filter(private_message_report::resolved.eq(false));
     }