mirror of
https://akkoma.dev/AkkomaGang/akkoma.git
synced 2024-11-23 06:58:58 +00:00
Redundant Repo.get_by usage was recently removed from the codebase
This commit is contained in:
parent
da64a5aece
commit
b5a2d384f7
|
@ -26,8 +26,8 @@ defmodule Pleroma.Web.AdminAPI.AdminAPIController 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 @@ defmodule Pleroma.Web.AdminAPI.AdminAPIController do
|
|||
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