1 defmodule Pleroma.Web.AkkomaAPI.FrontendSwitcherController do
2 use Pleroma.Web, :controller
5 @doc "GET /akkoma/frontend"
6 def switch(conn, _params) do
7 pickable = Config.get([:frontends, :pickable], [])
10 |> put_view(Pleroma.Web.AkkomaAPI.FrontendSwitcherView)
11 |> render("switch.html", choices: pickable)
14 @doc "POST /akkoma/frontend"
15 def do_switch(conn, params) do
17 |> put_resp_cookie("preferred_frontend", params["frontend"])
18 |> html("<meta http-equiv=\"refresh\" content=\"0; url=/\">")