From: Dessalines Date: Tue, 6 Jun 2023 09:01:48 +0000 (-0400) Subject: Fix *All* reports not showing. Fixes #2902 (#2903) X-Git-Url: http://these/git/%22%7Burl%7D/%22https:/image.com/%7B%60%24%7BghostArchiveUrl%7D/%7Brss%7D?a=commitdiff_plain;h=bb625c36711f8c7d634ebacc36d175bcef9a0725;p=lemmy.git Fix *All* reports not showing. Fixes #2902 (#2903) * Fix *All* reports not showing. Fixes #2902 * Fix *All* reports not showing. Fixes #2902 * Fixing tests. --- 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)); }