]> Untitled Git - lemmy.git/blobdiff - crates/db_views/src/comment_report_view.rs
Reduce amount of columns selected (#3755)
[lemmy.git] / crates / db_views / src / comment_report_view.rs
index a92b3806333af1f4c7560df109e916d172af1257..1b943eab8f5c5ee9dfcf611d7f8a2b33dc63ad19 100644 (file)
@@ -28,7 +28,7 @@ use lemmy_db_schema::{
   source::{
     comment::Comment,
     comment_report::CommentReport,
-    community::{Community, CommunityPersonBan},
+    community::Community,
     person::Person,
     post::Post,
   },
@@ -71,7 +71,7 @@ fn queries<'a>() -> Queries<
     person::all_columns,
     aliases::person1.fields(person::all_columns),
     comment_aggregates::all_columns,
-    community_person_ban::all_columns.nullable(),
+    community_person_ban::id.nullable().is_not_null(),
     comment_like::score.nullable(),
     aliases::person2.fields(person::all_columns).nullable(),
   );
@@ -228,7 +228,7 @@ impl JoinView for CommentReportView {
     Person,
     Person,
     CommentAggregates,
-    Option<CommunityPersonBan>,
+    bool,
     Option<i16>,
     Option<Person>,
   );
@@ -242,7 +242,7 @@ impl JoinView for CommentReportView {
       creator: a.4,
       comment_creator: a.5,
       counts: a.6,
-      creator_banned_from_community: a.7.is_some(),
+      creator_banned_from_community: a.7,
       my_vote: a.8,
       resolver: a.9,
     }