]> Untitled Git - lemmy.git/blobdiff - crates/apub/src/activities/community/update.rs
Make functions work with both connection and pool (#3420)
[lemmy.git] / crates / apub / src / activities / community / update.rs
index f8bbfa6ce8bc80177ed724ca69466a803df6aae2..3e697fddcca328b28c8ace2c63e6de173b5a86c8 100644 (file)
@@ -36,7 +36,7 @@ impl SendActivity for EditCommunity {
     context: &Data<LemmyContext>,
   ) -> Result<(), LemmyError> {
     let local_user_view = local_user_view_from_jwt(&request.auth, context).await?;
-    let community = Community::read(context.pool(), request.community_id).await?;
+    let community = Community::read(&mut context.pool(), request.community_id).await?;
     UpdateCommunity::send(community.into(), &local_user_view.person.into(), context).await
   }
 }
@@ -97,7 +97,7 @@ impl ActivityHandler for UpdateCommunity {
 
     let community_update_form = self.object.into_update_form();
 
-    Community::update(context.pool(), community.id, &community_update_form).await?;
+    Community::update(&mut context.pool(), community.id, &community_update_form).await?;
     Ok(())
   }
 }
@@ -112,7 +112,7 @@ impl SendActivity for HideCommunity {
     context: &Data<LemmyContext>,
   ) -> Result<(), LemmyError> {
     let local_user_view = local_user_view_from_jwt(&request.auth, context).await?;
-    let community = Community::read(context.pool(), request.community_id).await?;
+    let community = Community::read(&mut context.pool(), request.community_id).await?;
     UpdateCommunity::send(community.into(), &local_user_view.person.into(), context).await
   }
 }