Fix OpenAPI spec for preferred_frontend endpoint

The spec was copied from another endpoint, including the operation id,
leading to scrubbing the valid parameters from the request and simply
not working.

Signed-off-by: nicole mikołajczyk <git@mkljczk.pl>
This commit is contained in:
Paweł Świątkowski 2024-02-03 14:24:03 +01:00 committed by nicole mikołajczyk
commit 8827e51170
3 changed files with 22 additions and 10 deletions

View file

@ -30,9 +30,9 @@ defmodule Pleroma.Web.ApiSpec.PleromaFrontendSettingsOperation do
def update_preferred_frontend_operation() do
%Operation{
tags: ["Frontends"],
summary: "Frontend Settings Profiles",
description: "List frontend setting profiles",
operationId: "PleromaAPI.FrontendSettingsController.available_frontends",
summary: "Update preferred frontend setting",
description: "Store preferred frontend in cookies",
operationId: "PleromaAPI.FrontendSettingsController.update_preferred_frontend",
requestBody:
request_body(
"Frontend",

View file

@ -81,15 +81,8 @@ defmodule Pleroma.Web.Plugs.FrontendStatic do
end
end
<<<<<<< HEAD
=======
def preferred_or_fallback(conn, fallback), do: fallback
defp enabled?(if_opt) when is_function(if_opt), do: if_opt.()
defp enabled?(true), do: true
defp enabled?(_), do: false
>>>>>>> de64c6c54a (add selection UI)
defp invalid_path?(list) do
invalid_path?(list, :binary.compile_pattern(["/", "\\", ":", "\0"]))
end