Redundant Repo.get_by usage was recently removed from the codebase
This commit is contained in:
parent
da64a5aece
commit
b5a2d384f7
1 changed files with 4 additions and 4 deletions
|
@ -26,8 +26,8 @@ def user_delete(conn, %{"nickname" => nickname}) do
|
|||
end
|
||||
|
||||
def user_follow(conn, %{"follower" => follower_nick, "followed" => followed_nick}) do
|
||||
with %User{} = follower <- Repo.get_by(User, %{nickname: follower_nick}),
|
||||
%User{} = followed <- Repo.get_by(User, %{nickname: followed_nick}) do
|
||||
with %User{} = follower <- User.get_by_nickname(follower_nick),
|
||||
%User{} = followed <- User.get_by_nickname(followed_nick) do
|
||||
User.follow(follower, followed)
|
||||
end
|
||||
|
||||
|
@ -36,8 +36,8 @@ def user_follow(conn, %{"follower" => follower_nick, "followed" => followed_nick
|
|||
end
|
||||
|
||||
def user_unfollow(conn, %{"follower" => follower_nick, "followed" => followed_nick}) do
|
||||
with %User{} = follower <- Repo.get_by(User, %{nickname: follower_nick}),
|
||||
%User{} = followed <- Repo.get_by(User, %{nickname: followed_nick}) do
|
||||
with %User{} = follower <- User.get_by_nickname(follower_nick),
|
||||
%User{} = followed <- User.get_by_nickname(followed_nick) do
|
||||
User.unfollow(follower, followed)
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in a new issue