From: Nutomic Date: Fri, 29 Apr 2022 14:01:10 +0000 (+0200) Subject: Add restricted community field to CreateCommunity, UpdateCommunity (ref #2235) (... X-Git-Url: http://these/git/%7Bthis.state.postForm.url%7D?a=commitdiff_plain;h=dd5835fb6ee210af78ba876bf3e9f37ea1db521b;p=lemmy.git Add restricted community field to CreateCommunity, UpdateCommunity (ref #2235) (#2242) --- diff --git a/crates/api_common/src/community.rs b/crates/api_common/src/community.rs index 4b9209d6..49df41fa 100644 --- a/crates/api_common/src/community.rs +++ b/crates/api_common/src/community.rs @@ -34,6 +34,7 @@ pub struct CreateCommunity { pub icon: Option, pub banner: Option, pub nsfw: Option, + pub posting_restricted_to_mods: Option, pub auth: Sensitive, } @@ -94,6 +95,7 @@ pub struct EditCommunity { pub icon: Option, pub banner: Option, pub nsfw: Option, + pub posting_restricted_to_mods: Option, pub auth: Sensitive, } diff --git a/crates/api_crud/src/community/create.rs b/crates/api_crud/src/community/create.rs index 27bce73e..8d68d554 100644 --- a/crates/api_crud/src/community/create.rs +++ b/crates/api_crud/src/community/create.rs @@ -103,6 +103,7 @@ impl PerformCrud for CreateCommunity { followers_url: Some(generate_followers_url(&community_actor_id)?), inbox_url: Some(generate_inbox_url(&community_actor_id)?), shared_inbox_url: Some(Some(generate_shared_inbox_url(&community_actor_id)?)), + posting_restricted_to_mods: data.posting_restricted_to_mods, ..CommunityForm::default() }; diff --git a/crates/api_crud/src/community/update.rs b/crates/api_crud/src/community/update.rs index 6a98180b..4df708fc 100644 --- a/crates/api_crud/src/community/update.rs +++ b/crates/api_crud/src/community/update.rs @@ -64,6 +64,7 @@ impl PerformCrud for EditCommunity { icon, banner, nsfw: data.nsfw, + posting_restricted_to_mods: data.posting_restricted_to_mods, updated: Some(naive_now()), ..CommunityForm::default() };