From bb625c36711f8c7d634ebacc36d175bcef9a0725 Mon Sep 17 00:00:00 2001 From: Dessalines Date: Tue, 6 Jun 2023 05:01:48 -0400 Subject: [PATCH] Fix *All* reports not showing. Fixes #2902 (#2903) * Fix *All* reports not showing. Fixes #2902 * Fix *All* reports not showing. Fixes #2902 * Fixing tests. --- crates/db_views/src/comment_report_view.rs | 3 ++- crates/db_views/src/post_report_view.rs | 3 ++- crates/db_views/src/private_message_report_view.rs | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/crates/db_views/src/comment_report_view.rs b/crates/db_views/src/comment_report_view.rs index a5b8d71d..8d4ae54e 100644 --- a/crates/db_views/src/comment_report_view.rs +++ b/crates/db_views/src/comment_report_view.rs @@ -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 diff --git a/crates/db_views/src/post_report_view.rs b/crates/db_views/src/post_report_view.rs index 29136a35..14a91fc2 100644 --- a/crates/db_views/src/post_report_view.rs +++ b/crates/db_views/src/post_report_view.rs @@ -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 diff --git a/crates/db_views/src/private_message_report_view.rs b/crates/db_views/src/private_message_report_view.rs index ace9a5da..2bcad6f8 100644 --- a/crates/db_views/src/private_message_report_view.rs +++ b/crates/db_views/src/private_message_report_view.rs @@ -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)); } -- 2.44.1