Add proper error message when accessing followers/followings w/ auth
Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
@@ -274,6 +274,14 @@ defmodule Mobilizon.GraphQL.Resolvers.Admin do
|
||||
end
|
||||
end
|
||||
|
||||
def list_relay_followers(_parent, _args, %{context: %{current_user: %User{}}}) do
|
||||
{:error, :unauthorized}
|
||||
end
|
||||
|
||||
def list_relay_followers(_parent, _args, _resolution) do
|
||||
{:error, :unauthenticated}
|
||||
end
|
||||
|
||||
def list_relay_followings(
|
||||
_parent,
|
||||
%{page: page, limit: limit},
|
||||
@@ -288,6 +296,14 @@ defmodule Mobilizon.GraphQL.Resolvers.Admin do
|
||||
end
|
||||
end
|
||||
|
||||
def list_relay_followings(_parent, _args, %{context: %{current_user: %User{}}}) do
|
||||
{:error, :unauthorized}
|
||||
end
|
||||
|
||||
def list_relay_followings(_parent, _args, _resolution) do
|
||||
{:error, :unauthenticated}
|
||||
end
|
||||
|
||||
def create_relay(_parent, %{address: address}, %{context: %{current_user: %User{role: role}}})
|
||||
when is_admin(role) do
|
||||
case Relay.follow(address) do
|
||||
|
||||
Reference in New Issue
Block a user