- let community_follower_form = CommunityFollowerForm {
- community_id: community.id,
- person_id: person.id,
- pending: false,
- };
+ match object {
+ UserOrCommunity::User(u) => {
+ let form = PersonFollowerForm {
+ person_id: u.id,
+ follower_id: person.id,
+ pending: false,
+ };
+ PersonFollower::unfollow(&mut context.pool(), &form).await?;
+ }
+ UserOrCommunity::Community(c) => {
+ let form = CommunityFollowerForm {
+ community_id: c.id,
+ person_id: person.id,
+ pending: false,
+ };
+ CommunityFollower::unfollow(&mut context.pool(), &form).await?;
+ }
+ }