summaryrefslogtreecommitdiff
path: root/lib/pleroma/web/mastodon_api/controllers/status_controller.ex
diff options
context:
space:
mode:
authorlain <lain@soykaf.club>2020-03-04 18:09:06 +0100
committerlain <lain@soykaf.club>2020-03-04 18:09:06 +0100
commit4bce13fa2f9c9c234f8cf8d03e150f3478ff7483 (patch)
tree99e8327bbd27c71b87143050c218703f3623d162 /lib/pleroma/web/mastodon_api/controllers/status_controller.ex
parent6f7a8c43a200d2d0166e4e544aee1e6104bcb671 (diff)
MastodonController: Return 404 errors correctly.
Diffstat (limited to 'lib/pleroma/web/mastodon_api/controllers/status_controller.ex')
-rw-r--r--lib/pleroma/web/mastodon_api/controllers/status_controller.ex3
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/pleroma/web/mastodon_api/controllers/status_controller.ex b/lib/pleroma/web/mastodon_api/controllers/status_controller.ex
index b0048102f..5c90065f6 100644
--- a/lib/pleroma/web/mastodon_api/controllers/status_controller.ex
+++ b/lib/pleroma/web/mastodon_api/controllers/status_controller.ex
@@ -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