Add restricted community field to CreateCommunity, UpdateCommunity (ref #2235) (#2242)

This commit is contained in:
Nutomic 2022-04-29 16:01:10 +02:00 committed by GitHub
parent 7058cfa1cf
commit dd5835fb6e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 4 additions and 0 deletions

View File

@ -34,6 +34,7 @@ pub struct CreateCommunity {
pub icon: Option<String>,
pub banner: Option<String>,
pub nsfw: Option<bool>,
pub posting_restricted_to_mods: Option<bool>,
pub auth: Sensitive<String>,
}
@ -94,6 +95,7 @@ pub struct EditCommunity {
pub icon: Option<String>,
pub banner: Option<String>,
pub nsfw: Option<bool>,
pub posting_restricted_to_mods: Option<bool>,
pub auth: Sensitive<String>,
}

View File

@ -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()
};

View File

@ -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()
};