analysis
Signed-off-by: nicole mikołajczyk <git@mkljczk.pl>
This commit is contained in:
parent
78c4332218
commit
cc51ee8662
3 changed files with 10 additions and 9 deletions
|
|
@ -9,7 +9,7 @@ defmodule Pleroma.Web.ApiSpec.PleromaFrontendSettingsOperation do
|
|||
apply(__MODULE__, operation, [])
|
||||
end
|
||||
|
||||
def available_frontends_operation() do
|
||||
def available_frontends_operation do
|
||||
%Operation{
|
||||
tags: ["Preferred frontends"],
|
||||
summary: "Frontend settings profiles",
|
||||
|
|
@ -27,7 +27,7 @@ defmodule Pleroma.Web.ApiSpec.PleromaFrontendSettingsOperation do
|
|||
}
|
||||
end
|
||||
|
||||
def update_preferred_frontend_operation() do
|
||||
def update_preferred_frontend_operation do
|
||||
%Operation{
|
||||
tags: ["Preferred frontends"],
|
||||
summary: "Update preferred frontend setting",
|
||||
|
|
@ -50,10 +50,13 @@ defmodule Pleroma.Web.ApiSpec.PleromaFrontendSettingsOperation do
|
|||
),
|
||||
responses: %{
|
||||
200 =>
|
||||
Operation.response("Frontends", "application/json", %Schema{
|
||||
type: :array,
|
||||
items: %Schema{
|
||||
type: :string
|
||||
Operation.response("Preferred frontend", "application/json", %Schema{
|
||||
type: :object,
|
||||
properties: %{
|
||||
frontend_name: %Schema{
|
||||
type: :string,
|
||||
description: "Frontend name"
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
|
|
|
|||
|
|
@ -15,6 +15,6 @@ defmodule Pleroma.Web.FrontendSwitcher.FrontendSwitcherController do
|
|||
def do_switch(conn, params) do
|
||||
conn
|
||||
|> put_resp_cookie("preferred_frontend", params["frontend"])
|
||||
|> html("<meta http-equiv=\"refresh\" content=\"0; url=/\">")
|
||||
|> html(~s(<meta http-equiv="refresh" content="0; url=/">))
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -1,8 +1,6 @@
|
|||
defmodule Pleroma.Web.PleromaAPI.FrontendSettingsControllerTest do
|
||||
use Pleroma.Web.ConnCase, async: false
|
||||
|
||||
import Pleroma.Factory
|
||||
|
||||
describe "PUT /api/v1/pleroma/preferred_frontend" do
|
||||
test "sets a cookie with selected frontend" do
|
||||
%{conn: conn} = oauth_access(["read"])
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue