From: Alexander Strizhakov Date: Wed, 27 May 2020 10:55:42 +0000 (+0000) Subject: Apply suggestion to lib/pleroma/web/admin_api/controllers/admin_api_controller.ex X-Git-Url: https://git.squeep.com/?a=commitdiff_plain;h=047a11c48f2bc88b6b278b6a5acd94807c7e5138;p=akkoma Apply suggestion to lib/pleroma/web/admin_api/controllers/admin_api_controller.ex --- diff --git a/lib/pleroma/web/admin_api/controllers/admin_api_controller.ex b/lib/pleroma/web/admin_api/controllers/admin_api_controller.ex index 6aedccec6..783203c07 100644 --- a/lib/pleroma/web/admin_api/controllers/admin_api_controller.ex +++ b/lib/pleroma/web/admin_api/controllers/admin_api_controller.ex @@ -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})