X-Git-Url: http://these/git/?a=blobdiff_plain;f=crates%2Fdb_views%2Fsrc%2Fcomment_report_view.rs;h=98ff555b74f11f22abb8961efa08411010b7c191;hb=c8063f3267cf2b3622f1fdc69128c6b55feefbbc;hp=1b943eab8f5c5ee9dfcf611d7f8a2b33dc63ad19;hpb=9b710a2ed3df7411f97e873ae445e96fa5a8bd56;p=lemmy.git diff --git a/crates/db_views/src/comment_report_view.rs b/crates/db_views/src/comment_report_view.rs index 1b943eab..98ff555b 100644 --- a/crates/db_views/src/comment_report_view.rs +++ b/crates/db_views/src/comment_report_view.rs @@ -113,7 +113,7 @@ fn queries<'a>() -> Queries< query = query.filter(post::community_id.eq(community_id)); } - if options.unresolved_only.unwrap_or(false) { + if options.unresolved_only { query = query.filter(comment_report::resolved.eq(false)); } @@ -206,7 +206,7 @@ pub struct CommentReportQuery { pub community_id: Option, pub page: Option, pub limit: Option, - pub unresolved_only: Option, + pub unresolved_only: bool, } impl CommentReportQuery { @@ -569,7 +569,7 @@ mod tests { // Do a batch read of timmys reports // It should only show saras, which is unresolved let reports_after_resolve = CommentReportQuery { - unresolved_only: (Some(true)), + unresolved_only: (true), ..Default::default() } .list(pool, &inserted_timmy)