]> Untitled Git - lemmy.git/blobdiff - crates/api_crud/src/community/delete.rs
Make functions work with both connection and pool (#3420)
[lemmy.git] / crates / api_crud / src / community / delete.rs
index 97641f57ece30defab415baeec8791183a3b6d83..d3e58d56ce22e7f029da91b009890e43dcaaeeb8 100644 (file)
@@ -25,7 +25,7 @@ impl PerformCrud for DeleteCommunity {
     // Fetch the community mods
     let community_id = data.community_id;
     let community_mods =
-      CommunityModeratorView::for_community(context.pool(), community_id).await?;
+      CommunityModeratorView::for_community(&mut context.pool(), community_id).await?;
 
     // Make sure deleter is the top mod
     is_top_mod(&local_user_view, &community_mods)?;
@@ -34,7 +34,7 @@ impl PerformCrud for DeleteCommunity {
     let community_id = data.community_id;
     let deleted = data.deleted;
     Community::update(
-      context.pool(),
+      &mut context.pool(),
       community_id,
       &CommunityUpdateForm::builder()
         .deleted(Some(deleted))