Err(_e) => return Err(APIError::err("community_follower_already_exists").into()),
};
} else {
- match CommunityFollower::ignore(&conn, &community_follower_form) {
+ match CommunityFollower::unfollow(&conn, &community_follower_form) {
Ok(user) => user,
Err(_e) => return Err(APIError::err("community_follower_already_exists").into()),
};
user.send_follow(&community.actor_id, &conn)?;
} else {
user.send_unfollow(&community.actor_id, &conn)?;
- match CommunityFollower::ignore(&conn, &community_follower_form) {
+ match CommunityFollower::unfollow(&conn, &community_follower_form) {
Ok(user) => user,
Err(_e) => return Err(APIError::err("community_follower_already_exists").into()),
};
user_id: user.id,
};
- CommunityFollower::ignore(&conn, &community_follower_form).ok();
+ CommunityFollower::unfollow(&conn, &community_follower_form).ok();
Ok(HttpResponse::Ok().finish())
}
.values(community_follower_form)
.get_result::<Self>(conn)
}
- fn ignore(
+ fn unfollow(
conn: &PgConnection,
community_follower_form: &CommunityFollowerForm,
) -> Result<usize, Error> {
let read_community = Community::read(&conn, inserted_community.id).unwrap();
let updated_community =
Community::update(&conn, inserted_community.id, &new_community).unwrap();
- let ignored_community = CommunityFollower::ignore(&conn, &community_follower_form).unwrap();
+ let ignored_community = CommunityFollower::unfollow(&conn, &community_follower_form).unwrap();
let left_community = CommunityModerator::leave(&conn, &community_user_form).unwrap();
let unban = CommunityUserBan::unban(&conn, &community_user_ban_form).unwrap();
let num_deleted = Community::delete(&conn, inserted_community.id).unwrap();
fn follow(conn: &PgConnection, form: &T) -> Result<Self, Error>
where
Self: Sized;
- fn ignore(conn: &PgConnection, form: &T) -> Result<usize, Error>
+ fn unfollow(conn: &PgConnection, form: &T) -> Result<usize, Error>
where
Self: Sized;
}