X-Git-Url: http://these/git/?a=blobdiff_plain;f=crates%2Fapi_crud%2Fsrc%2Fcommunity%2Fdelete.rs;h=dff00696043e61859abcc0b609e1944064a0dfb7;hb=235cc8b22897bfb3e71ba3dbd725d36863fea8ba;hp=441f45811c29c3709190dec20fa1870e1a1b29fc;hpb=276a8c2bd3e4fd1323e66b808675cf14cf6f75c5;p=lemmy.git diff --git a/crates/api_crud/src/community/delete.rs b/crates/api_crud/src/community/delete.rs index 441f4581..dff00696 100644 --- a/crates/api_crud/src/community/delete.rs +++ b/crates/api_crud/src/community/delete.rs @@ -5,7 +5,10 @@ use lemmy_api_common::{ utils::{blocking, get_local_user_view_from_jwt}, }; use lemmy_apub::activities::deletion::{send_apub_delete_in_community, DeletableObjects}; -use lemmy_db_schema::source::community::Community; +use lemmy_db_schema::{ + source::community::{Community, CommunityUpdateForm}, + traits::Crud, +}; use lemmy_db_views_actor::structs::CommunityModeratorView; use lemmy_utils::{error::LemmyError, ConnectionId}; use lemmy_websocket::{send::send_community_ws_message, LemmyContext, UserOperationCrud}; @@ -40,7 +43,13 @@ impl PerformCrud for DeleteCommunity { let community_id = data.community_id; let deleted = data.deleted; let updated_community = blocking(context.pool(), move |conn| { - Community::update_deleted(conn, community_id, deleted) + Community::update( + conn, + community_id, + &CommunityUpdateForm::builder() + .deleted(Some(deleted)) + .build(), + ) }) .await? .map_err(|e| LemmyError::from_error_message(e, "couldnt_update_community"))?;