mirror of
https://git.pleroma.social/pleroma/pleroma.git
synced 2024-11-19 16:10:59 +00:00
Apply suggestion to lib/pleroma/web/admin_api/controllers/admin_api_controller.ex
This commit is contained in:
parent
3249141588
commit
047a11c48f
1 changed files with 1 additions and 5 deletions
|
@ -715,11 +715,7 @@ defmodule Pleroma.Web.AdminAPI.AdminAPIController do
|
|||
json(conn, %{status: "success"})
|
||||
else
|
||||
{:error, changeset} ->
|
||||
errors =
|
||||
Enum.reduce(changeset.errors, %{}, fn
|
||||
{key, {error, _}}, acc ->
|
||||
Map.put(acc, key, error)
|
||||
end)
|
||||
errors = Map.new(changeset.errors, fn {key, {error, _}} -> {key, error} end)
|
||||
|
||||
json(conn, %{errors: errors})
|
||||
|
||||
|
|
Loading…
Reference in a new issue