From dd5835fb6ee210af78ba876bf3e9f37ea1db521b Mon Sep 17 00:00:00 2001 From: Nutomic Date: Fri, 29 Apr 2022 16:01:10 +0200 Subject: [PATCH] Add restricted community field to CreateCommunity, UpdateCommunity (ref #2235) (#2242) --- crates/api_common/src/community.rs | 2 ++ crates/api_crud/src/community/create.rs | 1 + crates/api_crud/src/community/update.rs | 1 + 3 files changed, 4 insertions(+) diff --git a/crates/api_common/src/community.rs b/crates/api_common/src/community.rs index 4b9209d6a..49df41fae 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 27bce73e0..8d68d554d 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 6a98180b4..4df708fcc 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() };