Preload /api/pleroma/frontend_configurations, fixes #1932
This commit is contained in:
parent
42b4b95467
commit
83ae45b000
4 changed files with 24 additions and 5 deletions
|
|
@ -74,11 +74,7 @@ defmodule Pleroma.Web.TwitterAPI.UtilController do
|
|||
end
|
||||
|
||||
def frontend_configurations(conn, _params) do
|
||||
config =
|
||||
Config.get(:frontend_configurations, %{})
|
||||
|> Enum.into(%{})
|
||||
|
||||
json(conn, config)
|
||||
render(conn, "frontend_configurations.json")
|
||||
end
|
||||
|
||||
def emoji(conn, _params) do
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@
|
|||
defmodule Pleroma.Web.TwitterAPI.UtilView do
|
||||
use Pleroma.Web, :view
|
||||
import Phoenix.HTML.Form
|
||||
alias Pleroma.Config
|
||||
alias Pleroma.Web
|
||||
|
||||
def status_net_config(instance) do
|
||||
|
|
@ -19,4 +20,9 @@ defmodule Pleroma.Web.TwitterAPI.UtilView do
|
|||
</config>
|
||||
"""
|
||||
end
|
||||
|
||||
def render("frontend_configurations.json", _) do
|
||||
Config.get(:frontend_configurations, %{})
|
||||
|> Enum.into(%{})
|
||||
end
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue