- #[tracing::instrument(skip(context, _websocket_id))]
- async fn perform(
- &self,
- context: &Data<LemmyContext>,
- _websocket_id: Option<ConnectionId>,
- ) -> Result<CommunityResponse, LemmyError> {
- let data: &FollowCommunity = self;
- let local_user_view =
- get_local_user_view_from_jwt(&data.auth, context.pool(), context.secret()).await?;
-
- let community_id = data.community_id;
- let community: ApubCommunity = Community::read(context.pool(), community_id).await?.into();
- let community_follower_form = CommunityFollowerForm {
- community_id: data.community_id,
- person_id: local_user_view.person.id,
- pending: false,
- };
+ let community = Community::read(&mut context.pool(), data.community_id).await?;
+ let mut community_follower_form = CommunityFollowerForm {
+ community_id: community.id,
+ person_id: local_user_view.person.id,
+ pending: false,
+ };