MastodonController: Return 404 errors correctly.

This commit is contained in:
lain 2020-03-04 18:09:06 +01:00
commit 4bce13fa2f
3 changed files with 49 additions and 18 deletions

View file

@ -175,6 +175,8 @@ defmodule Pleroma.Web.MastodonAPI.StatusController do
for: user,
with_direct_conversation_id: true
)
else
_ -> {:error, :not_found}
end
end
@ -183,6 +185,7 @@ defmodule Pleroma.Web.MastodonAPI.StatusController do
with {:ok, %Activity{}} <- CommonAPI.delete(id, user) do
json(conn, %{})
else
{:error, :not_found} = e -> e
_e -> render_error(conn, :forbidden, "Can't delete this post")
end
end