add api for themes

This commit is contained in:
Luna D. 2024-12-20 18:50:44 +01:00
parent a3a6f9bd7b
commit d5cf9aeb9d
No known key found for this signature in database
GPG key ID: 4B1C63448394F688
2 changed files with 13 additions and 0 deletions

View file

@ -0,0 +1,11 @@
defmodule PhilomenaWeb.Api.Json.ThemeController do
use PhilomenaWeb, :controller
alias PhilomenaWeb.SettingView
def index(conn, _params) do
conn
|> put_resp_content_type("application/json")
|> send_resp(200, SettingView.theme_paths_json(conn))
end
end

View file

@ -157,6 +157,8 @@ defmodule PhilomenaWeb.Router do
resources "/posts", Forum.Topic.PostController, only: [:show, :index]
end
end
resources "/themes", ThemeController, only: [:index]
end
scope "/", PhilomenaWeb do