]> Untitled Git - lemmy.git/blobdiff - crates/db_views_moderator/src/structs.rs
Get rid of Safe Views, use serde_skip (#2767)
[lemmy.git] / crates / db_views_moderator / src / structs.rs
index 85dc006b17a8b26dcc6d4ea6ef38530161e1c512..4a62ba9e41a6634e4c58fe5427509a010c4e8bb0 100644 (file)
@@ -2,7 +2,7 @@ use lemmy_db_schema::{
   newtypes::{CommunityId, PersonId},
   source::{
     comment::Comment,
-    community::CommunitySafe,
+    community::Community,
     moderator::{
       AdminPurgeComment,
       AdminPurgeCommunity,
@@ -20,7 +20,7 @@ use lemmy_db_schema::{
       ModRemovePost,
       ModTransferCommunity,
     },
-    person::PersonSafe,
+    person::Person,
     post::Post,
   },
 };
@@ -29,113 +29,113 @@ use serde::{Deserialize, Serialize};
 #[derive(Debug, Serialize, Deserialize, Clone)]
 pub struct ModAddCommunityView {
   pub mod_add_community: ModAddCommunity,
-  pub moderator: Option<PersonSafe>,
-  pub community: CommunitySafe,
-  pub modded_person: PersonSafe,
+  pub moderator: Option<Person>,
+  pub community: Community,
+  pub modded_person: Person,
 }
 
 #[derive(Debug, Serialize, Deserialize, Clone)]
 pub struct ModAddView {
   pub mod_add: ModAdd,
-  pub moderator: Option<PersonSafe>,
-  pub modded_person: PersonSafe,
+  pub moderator: Option<Person>,
+  pub modded_person: Person,
 }
 
 #[derive(Debug, Serialize, Deserialize, Clone)]
 pub struct ModBanFromCommunityView {
   pub mod_ban_from_community: ModBanFromCommunity,
-  pub moderator: Option<PersonSafe>,
-  pub community: CommunitySafe,
-  pub banned_person: PersonSafe,
+  pub moderator: Option<Person>,
+  pub community: Community,
+  pub banned_person: Person,
 }
 
 #[derive(Debug, Serialize, Deserialize, Clone)]
 pub struct ModBanView {
   pub mod_ban: ModBan,
-  pub moderator: Option<PersonSafe>,
-  pub banned_person: PersonSafe,
+  pub moderator: Option<Person>,
+  pub banned_person: Person,
 }
 
 #[derive(Debug, Serialize, Deserialize, Clone)]
 pub struct ModHideCommunityView {
   pub mod_hide_community: ModHideCommunity,
-  pub admin: Option<PersonSafe>,
-  pub community: CommunitySafe,
+  pub admin: Option<Person>,
+  pub community: Community,
 }
 
 #[derive(Debug, Serialize, Deserialize, Clone)]
 pub struct ModLockPostView {
   pub mod_lock_post: ModLockPost,
-  pub moderator: Option<PersonSafe>,
+  pub moderator: Option<Person>,
   pub post: Post,
-  pub community: CommunitySafe,
+  pub community: Community,
 }
 
 #[derive(Debug, Serialize, Deserialize, Clone)]
 pub struct ModRemoveCommentView {
   pub mod_remove_comment: ModRemoveComment,
-  pub moderator: Option<PersonSafe>,
+  pub moderator: Option<Person>,
   pub comment: Comment,
-  pub commenter: PersonSafe,
+  pub commenter: Person,
   pub post: Post,
-  pub community: CommunitySafe,
+  pub community: Community,
 }
 
 #[derive(Debug, Serialize, Deserialize, Clone)]
 pub struct ModRemoveCommunityView {
   pub mod_remove_community: ModRemoveCommunity,
-  pub moderator: Option<PersonSafe>,
-  pub community: CommunitySafe,
+  pub moderator: Option<Person>,
+  pub community: Community,
 }
 
 #[derive(Debug, Serialize, Deserialize, Clone)]
 pub struct ModRemovePostView {
   pub mod_remove_post: ModRemovePost,
-  pub moderator: Option<PersonSafe>,
+  pub moderator: Option<Person>,
   pub post: Post,
-  pub community: CommunitySafe,
+  pub community: Community,
 }
 
 #[derive(Debug, Serialize, Deserialize, Clone)]
 pub struct ModFeaturePostView {
   pub mod_feature_post: ModFeaturePost,
-  pub moderator: Option<PersonSafe>,
+  pub moderator: Option<Person>,
   pub post: Post,
-  pub community: CommunitySafe,
+  pub community: Community,
 }
 
 #[derive(Debug, Serialize, Deserialize, Clone)]
 pub struct ModTransferCommunityView {
   pub mod_transfer_community: ModTransferCommunity,
-  pub moderator: Option<PersonSafe>,
-  pub community: CommunitySafe,
-  pub modded_person: PersonSafe,
+  pub moderator: Option<Person>,
+  pub community: Community,
+  pub modded_person: Person,
 }
 
 #[derive(Debug, Serialize, Deserialize, Clone)]
 pub struct AdminPurgeCommentView {
   pub admin_purge_comment: AdminPurgeComment,
-  pub admin: Option<PersonSafe>,
+  pub admin: Option<Person>,
   pub post: Post,
 }
 
 #[derive(Debug, Serialize, Deserialize, Clone)]
 pub struct AdminPurgeCommunityView {
   pub admin_purge_community: AdminPurgeCommunity,
-  pub admin: Option<PersonSafe>,
+  pub admin: Option<Person>,
 }
 
 #[derive(Debug, Serialize, Deserialize, Clone)]
 pub struct AdminPurgePersonView {
   pub admin_purge_person: AdminPurgePerson,
-  pub admin: Option<PersonSafe>,
+  pub admin: Option<Person>,
 }
 
 #[derive(Debug, Serialize, Deserialize, Clone)]
 pub struct AdminPurgePostView {
   pub admin_purge_post: AdminPurgePost,
-  pub admin: Option<PersonSafe>,
-  pub community: CommunitySafe,
+  pub admin: Option<Person>,
+  pub community: Community,
 }
 
 #[derive(Debug, Serialize, Deserialize, Clone, Copy)]