fix(follow-instances): Show correct error message when trying to follow already following actor

Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
Thomas Citharel
2023-04-26 16:35:24 +02:00
parent 8543204bd9
commit d969c6648f
2 changed files with 11 additions and 1 deletions

View File

@@ -527,6 +527,12 @@ defmodule Mobilizon.GraphQL.Resolvers.Admin do
Instances.refresh()
get_instance(parent, args, resolution)
{:error, :follow_pending} ->
{:error, dgettext("errors", "This instance is pending follow approval")}
{:error, :already_following} ->
{:error, dgettext("errors", "You are already following this instance")}
{:error, :http_error} ->
{:error, dgettext("errors", "Unable to find an instance to follow at this address")}