]> Untitled Git - lemmy.git/blobdiff - crates/apub/src/http/community.rs
Make functions work with both connection and pool (#3420)
[lemmy.git] / crates / apub / src / http / community.rs
index 19793674c48389ae9b343ebe37d165096a98dc6f..18ad860b0adbd6a626167640a93e0475c32183f9 100644 (file)
@@ -33,7 +33,7 @@ pub(crate) async fn get_apub_community_http(
   context: Data<LemmyContext>,
 ) -> Result<HttpResponse, LemmyError> {
   let community: ApubCommunity =
-    Community::read_from_name(context.pool(), &info.community_name, true)
+    Community::read_from_name(&mut context.pool(), &info.community_name, true)
       .await?
       .into();
 
@@ -64,7 +64,8 @@ pub(crate) async fn get_apub_community_followers(
   info: web::Path<CommunityQuery>,
   context: Data<LemmyContext>,
 ) -> Result<HttpResponse, LemmyError> {
-  let community = Community::read_from_name(context.pool(), &info.community_name, false).await?;
+  let community =
+    Community::read_from_name(&mut context.pool(), &info.community_name, false).await?;
   let followers = GroupFollowers::new(community, &context).await?;
   create_apub_response(&followers)
 }
@@ -76,7 +77,7 @@ pub(crate) async fn get_apub_community_outbox(
   context: Data<LemmyContext>,
 ) -> Result<HttpResponse, LemmyError> {
   let community: ApubCommunity =
-    Community::read_from_name(context.pool(), &info.community_name, false)
+    Community::read_from_name(&mut context.pool(), &info.community_name, false)
       .await?
       .into();
   if community.deleted || community.removed {
@@ -92,7 +93,7 @@ pub(crate) async fn get_apub_community_moderators(
   context: Data<LemmyContext>,
 ) -> Result<HttpResponse, LemmyError> {
   let community: ApubCommunity =
-    Community::read_from_name(context.pool(), &info.community_name, false)
+    Community::read_from_name(&mut context.pool(), &info.community_name, false)
       .await?
       .into();
   if community.deleted || community.removed {
@@ -108,7 +109,7 @@ pub(crate) async fn get_apub_community_featured(
   context: Data<LemmyContext>,
 ) -> Result<HttpResponse, LemmyError> {
   let community: ApubCommunity =
-    Community::read_from_name(context.pool(), &info.community_name, false)
+    Community::read_from_name(&mut context.pool(), &info.community_name, false)
       .await?
       .into();
   if community.deleted || community.removed {