mirror of
https://framagit.org/framasoft/mobilizon.git
synced 2024-12-22 07:52:43 +00:00
Handle already following group
Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
parent
f8eda4aac5
commit
f315685deb
1 changed files with 6 additions and 2 deletions
|
@ -330,8 +330,12 @@ defmodule Mobilizon.GraphQL.Resolvers.Group do
|
||||||
}) do
|
}) do
|
||||||
case Actors.get_actor(group_id) do
|
case Actors.get_actor(group_id) do
|
||||||
%Actor{type: :Group} = group ->
|
%Actor{type: :Group} = group ->
|
||||||
with {:ok, _activity, %Follower{} = follower} <- Actions.Follow.follow(actor, group) do
|
case Actions.Follow.follow(actor, group) do
|
||||||
|
{:ok, _activity, %Follower{} = follower} ->
|
||||||
{:ok, follower}
|
{:ok, follower}
|
||||||
|
|
||||||
|
{:error, :already_following} ->
|
||||||
|
{:error, dgettext("errors", "You are already following this group")}
|
||||||
end
|
end
|
||||||
|
|
||||||
nil ->
|
nil ->
|
||||||
|
|
Loading…
Reference in a new issue