]> Untitled Git - lemmy.git/blobdiff - crates/db_views_actor/src/community_person_ban_view.rs
Get rid of Safe Views, use serde_skip (#2767)
[lemmy.git] / crates / db_views_actor / src / community_person_ban_view.rs
index 0d7df921362714dc5cc3388766f9dd9123e0467d..ebfce9ba8041a7fb4ffde85b22082f1cd594a98a 100644 (file)
@@ -4,11 +4,7 @@ use diesel_async::RunQueryDsl;
 use lemmy_db_schema::{
   newtypes::{CommunityId, PersonId},
   schema::{community, community_person_ban, person},
-  source::{
-    community::{Community, CommunitySafe},
-    person::{Person, PersonSafe},
-  },
-  traits::ToSafe,
+  source::{community::Community, person::Person},
   utils::{get_conn, DbPool},
 };
 
@@ -22,10 +18,7 @@ impl CommunityPersonBanView {
     let (community, person) = community_person_ban::table
       .inner_join(community::table)
       .inner_join(person::table)
-      .select((
-        Community::safe_columns_tuple(),
-        Person::safe_columns_tuple(),
-      ))
+      .select((community::all_columns, person::all_columns))
       .filter(community_person_ban::community_id.eq(from_community_id))
       .filter(community_person_ban::person_id.eq(from_person_id))
       .filter(
@@ -34,7 +27,7 @@ impl CommunityPersonBanView {
           .or(community_person_ban::expires.gt(now)),
       )
       .order_by(community_person_ban::published)
-      .first::<(CommunitySafe, PersonSafe)>(conn)
+      .first::<(Community, Person)>(conn)
       .await?;
 
     Ok(CommunityPersonBanView { community, person })