projects
/
akkoma
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge pull request 'Update OpenBSD docs' (#414) from lechindianer/akkoma:update-openb...
[akkoma]
/
lib
/
pleroma
/
web
/
admin_api
/
views
/
config_view.ex
diff --git
a/lib/pleroma/web/admin_api/views/config_view.ex
b/lib/pleroma/web/admin_api/views/config_view.ex
index c8560033eaa76bd6aaaa251592f23e0fac52cfb2..d29b4963dec2e9bf71e0446cf6f9bee4d4453775 100644
(file)
--- a/
lib/pleroma/web/admin_api/views/config_view.ex
+++ b/
lib/pleroma/web/admin_api/views/config_view.ex
@@
-1,16
+1,30
@@
+# Pleroma: A lightweight social networking server
+# Copyright © 2017-2021 Pleroma Authors <https://pleroma.social/>
+# SPDX-License-Identifier: AGPL-3.0-only
+
defmodule Pleroma.Web.AdminAPI.ConfigView do
use Pleroma.Web, :view
defmodule Pleroma.Web.AdminAPI.ConfigView do
use Pleroma.Web, :view
- def render("index.json", %{configs: configs}) do
+ alias Pleroma.ConfigDB
+
+ def render("index.json", %{configs: configs} = params) do
%{
%{
- configs: render_many(configs, __MODULE__, "show.json", as: :config)
+ configs: render_many(configs, __MODULE__, "show.json", as: :config),
+ need_reboot: params[:need_reboot]
}
end
def render("show.json", %{config: config}) do
}
end
def render("show.json", %{config: config}) do
- %{
- key: config.key,
- value: Pleroma.Web.AdminAPI.Config.from_binary_to_map(config.value)
+ map = %{
+ key: ConfigDB.to_json_types(config.key),
+ group: ConfigDB.to_json_types(config.group),
+ value: ConfigDB.to_json_types(config.value)
}
}
+
+ if config.db != [] do
+ Map.put(map, :db, config.db)
+ else
+ map
+ end
end
end
end
end