MastodonController: Return 404 errors correctly.
This commit is contained in:
parent
6f7a8c43a2
commit
4bce13fa2f
3 changed files with 49 additions and 18 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue