mirror of
https://github.com/LemmyNet/lemmy.git
synced 2024-11-16 17:34:00 +00:00
Renaming ignore to unfollow in followable trait.
This commit is contained in:
parent
4d82b89947
commit
e4ee8090b9
4 changed files with 6 additions and 6 deletions
|
@ -495,7 +495,7 @@ impl Perform for Oper<FollowCommunity> {
|
|||
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()),
|
||||
};
|
||||
|
@ -509,7 +509,7 @@ impl Perform for Oper<FollowCommunity> {
|
|||
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()),
|
||||
};
|
||||
|
|
|
@ -129,7 +129,7 @@ fn handle_undo_follow(
|
|||
user_id: user.id,
|
||||
};
|
||||
|
||||
CommunityFollower::ignore(&conn, &community_follower_form).ok();
|
||||
CommunityFollower::unfollow(&conn, &community_follower_form).ok();
|
||||
|
||||
Ok(HttpResponse::Ok().finish())
|
||||
}
|
||||
|
|
|
@ -216,7 +216,7 @@ impl Followable<CommunityFollowerForm> for CommunityFollower {
|
|||
.values(community_follower_form)
|
||||
.get_result::<Self>(conn)
|
||||
}
|
||||
fn ignore(
|
||||
fn unfollow(
|
||||
conn: &PgConnection,
|
||||
community_follower_form: &CommunityFollowerForm,
|
||||
) -> Result<usize, Error> {
|
||||
|
@ -351,7 +351,7 @@ mod tests {
|
|||
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();
|
||||
|
|
|
@ -44,7 +44,7 @@ pub trait Followable<T> {
|
|||
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;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue