]> Untitled Git - lemmy.git/blobdiff - crates/api_crud/src/community/remove.rs
Moving settings to Database. (#2492)
[lemmy.git] / crates / api_crud / src / community / remove.rs
index 5895a6cbc7e69ae6a2a5f2293e8997614b3f9834..be486144f1bddd9fc935d9499a90acd8f6ed6803 100644 (file)
@@ -7,7 +7,7 @@ use lemmy_api_common::{
 use lemmy_apub::activities::deletion::{send_apub_delete_in_community, DeletableObjects};
 use lemmy_db_schema::{
   source::{
-    community::Community,
+    community::{Community, CommunityUpdateForm},
     moderator::{ModRemoveCommunity, ModRemoveCommunityForm},
   },
   traits::Crud,
@@ -36,7 +36,13 @@ impl PerformCrud for RemoveCommunity {
     let community_id = data.community_id;
     let removed = data.removed;
     let updated_community = blocking(context.pool(), move |conn| {
-      Community::update_removed(conn, community_id, removed)
+      Community::update(
+        conn,
+        community_id,
+        &CommunityUpdateForm::builder()
+          .removed(Some(removed))
+          .build(),
+      )
     })
     .await?
     .map_err(|e| LemmyError::from_error_message(e, "couldnt_update_community"))?;