Style fixes

This commit is contained in:
Steph 2020-05-14 09:50:53 +00:00 committed by Stephanie Wilde-Hobbs
parent a2fcfc78c9
commit 5c6f575315
No known key found for this signature in database
GPG Key ID: CEF2BBFE18BD0E67

View File

@ -892,14 +892,9 @@ defmodule Pleroma.Web.AdminAPI.AdminAPIController do
end end
def config_descriptions(conn, _params) do def config_descriptions(conn, _params) do
descriptions_json = descriptions = Enum.filter(@descriptions, &whitelisted_config?/1)
@descriptions
|> Enum.filter(&whitelisted_config?/1)
|> Jason.encode!()
conn json(conn, descriptions)
|> Plug.Conn.put_resp_content_type("application/json")
|> Plug.Conn.send_resp(200, descriptions_json)
end end
def config_show(conn, %{"only_db" => true}) do def config_show(conn, %{"only_db" => true}) do
@ -954,7 +949,8 @@ defmodule Pleroma.Web.AdminAPI.AdminAPIController do
def config_update(conn, %{"configs" => configs}) do def config_update(conn, %{"configs" => configs}) do
with :ok <- configurable_from_database(conn) do with :ok <- configurable_from_database(conn) do
{_errors, results} = {_errors, results} =
Enum.filter(configs, &whitelisted_config?/1) configs
|> Enum.filter(&whitelisted_config?/1)
|> Enum.map(fn |> Enum.map(fn
%{"group" => group, "key" => key, "delete" => true} = params -> %{"group" => group, "key" => key, "delete" => true} = params ->
ConfigDB.delete(%{group: group, key: key, subkeys: params["subkeys"]}) ConfigDB.delete(%{group: group, key: key, subkeys: params["subkeys"]})