Fix unbookmarking
This commit is contained in:
parent
e7c3c36766
commit
e641651e2b
1 changed files with 3 additions and 2 deletions
|
@ -555,10 +555,11 @@ def bookmark_status(%{assigns: %{user: user}} = conn, %{"id" => id}) do
|
|||
end
|
||||
|
||||
def unbookmark_status(%{assigns: %{user: user}} = conn, %{"id" => id}) do
|
||||
with %Activity{} = activity <- Activity.get_by_id(id),
|
||||
with %Activity{} = activity <- Activity.get_by_id_with_object(id),
|
||||
%Object{} = object <- Object.normalize(activity),
|
||||
%User{} = user <- User.get_by_nickname(user.nickname),
|
||||
true <- Visibility.visible_for_user?(activity, user),
|
||||
{:ok, user} <- User.unbookmark(user, activity.data["object"]["id"]) do
|
||||
{:ok, user} <- User.unbookmark(user, object.data["id"]) do
|
||||
conn
|
||||
|> put_view(StatusView)
|
||||
|> try_render("status.json", %{activity: activity, for: user, as: :activity})
|
||||
|
|
Loading…
Reference in a new issue