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

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

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

* Fixing tests.
pull/2926/head^2
Dessalines 1 year ago committed by GitHub
parent ae88f618fd
commit bb625c3671
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -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

@ -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

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

Loading…
Cancel
Save