diff options
author | lain <lain@soykaf.club> | 2020-06-22 12:25:12 +0000 |
---|---|---|
committer | lain <lain@soykaf.club> | 2020-06-22 12:25:12 +0000 |
commit | 8b5bdd164e9df666bc12f4389540432b218b8e63 (patch) | |
tree | f3170bab8b09a82523195202db16a83f3cd88b94 /lib/pleroma/web/admin_api/controllers/fallback_controller.ex | |
parent | a0762fd5eaa47db38bfe7361d3cfeb9ced6ea2b8 (diff) | |
parent | c5863438ba9079a01a832fe48e203907fe5b37cd (diff) | |
download | pleroma-8b5bdd164e9df666bc12f4389540432b218b8e63.tar.gz |
Merge branch 'fix/1825-admin-api-error-codes' into 'develop'
Proper error codes for error in adminFE
Closes #1825
See merge request pleroma/pleroma!2665
Diffstat (limited to 'lib/pleroma/web/admin_api/controllers/fallback_controller.ex')
-rw-r--r-- | lib/pleroma/web/admin_api/controllers/fallback_controller.ex | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/pleroma/web/admin_api/controllers/fallback_controller.ex b/lib/pleroma/web/admin_api/controllers/fallback_controller.ex index 82965936d..34d90db07 100644 --- a/lib/pleroma/web/admin_api/controllers/fallback_controller.ex +++ b/lib/pleroma/web/admin_api/controllers/fallback_controller.ex @@ -17,6 +17,12 @@ defmodule Pleroma.Web.AdminAPI.FallbackController do |> json(%{error: reason}) end + def call(conn, {:errors, errors}) do + conn + |> put_status(:bad_request) + |> json(%{errors: errors}) + end + def call(conn, {:param_cast, _}) do conn |> put_status(:bad_request) |