]> Untitled Git - lemmy.git/blobdiff - crates/db_views/src/comment_report_view.rs
Adding hot_rank columns in place of function sorting. (#2952)
[lemmy.git] / crates / db_views / src / comment_report_view.rs
index df14ea5592032a98ba45f004e23f467e48610171..4a5397b32f633b067906b656fd56859f33497e78 100644 (file)
@@ -62,12 +62,7 @@ impl CommentReportView {
         community_person_ban::table.on(
           community::id
             .eq(community_person_ban::community_id)
-            .and(community_person_ban::person_id.eq(comment::creator_id))
-            .and(
-              community_person_ban::expires
-                .is_null()
-                .or(community_person_ban::expires.gt(now)),
-            ),
+            .and(community_person_ban::person_id.eq(comment::creator_id)),
         ),
       )
       .left_join(
@@ -213,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));
     }
 
@@ -482,6 +477,7 @@ mod tests {
         downvotes: 0,
         published: agg.published,
         child_count: 0,
+        hot_rank: 1728,
       },
       my_vote: None,
       resolver: None,
@@ -597,6 +593,7 @@ mod tests {
       .pool(pool)
       .my_person_id(inserted_timmy.id)
       .admin(false)
+      .unresolved_only(Some(true))
       .build()
       .list()
       .await