mirror of
https://github.com/LemmyNet/lemmy
synced 2024-11-11 01:10:29 +00:00
add missing api params
This commit is contained in:
parent
c537cf298a
commit
3d3e46433f
@ -54,6 +54,8 @@ pub struct CreateCommunity {
|
||||
/// Whether to restrict posting only to moderators.
|
||||
pub posting_restricted_to_mods: Option<bool>,
|
||||
pub discussion_languages: Option<Vec<LanguageId>>,
|
||||
/// Only users who are currently following the community can vote on posts and comments
|
||||
pub only_followers_can_vote: Option<bool>,
|
||||
}
|
||||
|
||||
#[derive(Debug, Serialize, Deserialize, Clone)]
|
||||
@ -147,6 +149,8 @@ pub struct EditCommunity {
|
||||
/// Whether to restrict posting only to moderators.
|
||||
pub posting_restricted_to_mods: Option<bool>,
|
||||
pub discussion_languages: Option<Vec<LanguageId>>,
|
||||
/// Only users who are currently following the community can vote on posts and comments
|
||||
pub only_followers_can_vote: Option<bool>,
|
||||
}
|
||||
|
||||
#[skip_serializing_none]
|
||||
|
@ -93,6 +93,7 @@ pub async fn create_community(
|
||||
.shared_inbox_url(Some(generate_shared_inbox_url(context.settings())?))
|
||||
.posting_restricted_to_mods(data.posting_restricted_to_mods)
|
||||
.instance_id(site_view.site.instance_id)
|
||||
.only_followers_can_vote(data.only_followers_can_vote)
|
||||
.build();
|
||||
|
||||
let inserted_community = Community::create(&mut context.pool(), &community_form)
|
||||
|
@ -68,6 +68,7 @@ pub async fn update_community(
|
||||
nsfw: data.nsfw,
|
||||
posting_restricted_to_mods: data.posting_restricted_to_mods,
|
||||
updated: Some(Some(naive_now())),
|
||||
only_followers_can_vote: data.only_followers_can_vote,
|
||||
..Default::default()
|
||||
};
|
||||
|
||||
|
@ -66,6 +66,7 @@ pub struct Community {
|
||||
/// Url where featured posts collection is served over Activitypub
|
||||
#[serde(skip)]
|
||||
pub featured_url: Option<DbUrl>,
|
||||
/// Only users who are currently following the community can vote on posts and comments
|
||||
pub only_followers_can_vote: bool,
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user