Fix *All* reports not showing. Fixes #2902 (#2903)

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

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

* Fixing tests.
ci-disk-usage
Dessalines 2023-06-06 05:01:48 -04:00 committed by GitHub
parent ae88f618fd
commit bb625c3671
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 5 additions and 3 deletions

View 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

View 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

View 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));
}