diff options
author | Felix <me@nutomic.com> | 2020-04-28 19:46:25 +0200 |
---|---|---|
committer | Felix <me@nutomic.com> | 2020-04-28 19:46:25 +0200 |
commit | 0c0c68398609d549a757a9c3a26ce2311075fa38 (patch) | |
tree | fe2f07a1ad195bc042217538fc2b3e54e7a44124 /server/src/api/community.rs | |
parent | 36d0e34668b94a955306a4b83947deb1f10689f2 (diff) |
Implement deleting communities
Diffstat (limited to 'server/src/api/community.rs')
-rw-r--r-- | server/src/api/community.rs | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/server/src/api/community.rs b/server/src/api/community.rs index 296a77ea..7610d1b7 100644 --- a/server/src/api/community.rs +++ b/server/src/api/community.rs @@ -358,7 +358,7 @@ impl Perform for Oper<EditCommunity> { published: None, }; - let _updated_community = match Community::update(&conn, data.edit_id, &community_form) { + let updated_community = match Community::update(&conn, data.edit_id, &community_form) { Ok(community) => community, Err(_e) => return Err(APIError::err("couldnt_update_community").into()), }; @@ -377,6 +377,11 @@ impl Perform for Oper<EditCommunity> { expires, }; ModRemoveCommunity::create(&conn, &form)?; + updated_community.send_delete(&conn)?; + } + + if let Some(_deleted) = data.deleted.to_owned() { + updated_community.send_delete(&conn)?; } let community_view = CommunityView::read(&conn, data.edit_id, Some(user_id))?; |