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

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

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

* Fixing tests.
This commit is contained in:
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));
}