]> Untitled Git - lemmy.git/blobdiff - crates/db_views/src/post_report_view.rs
Replace Option<bool> with bool for PostQuery and CommentQuery (#3819) (#3857)
[lemmy.git] / crates / db_views / src / post_report_view.rs
index 83526a1b05672b88f719fca579cec4659e451fd9..07037f940d065bc6e41c82e9df2da13d4ec536fd 100644 (file)
@@ -98,7 +98,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(post_report::resolved.eq(false));
     }
 
@@ -186,7 +186,7 @@ pub struct PostReportQuery {
   pub community_id: Option<CommunityId>,
   pub page: Option<i64>,
   pub limit: Option<i64>,
-  pub unresolved_only: Option<bool>,
+  pub unresolved_only: bool,
 }
 
 impl PostReportQuery {
@@ -532,7 +532,7 @@ mod tests {
     // Do a batch read of timmys reports
     // It should only show saras, which is unresolved
     let reports_after_resolve = PostReportQuery {
-      unresolved_only: (Some(true)),
+      unresolved_only: (true),
       ..Default::default()
     }
     .list(pool, &inserted_timmy)