mirror of
https://github.com/philomena-dev/philomena.git
synced 2025-01-19 22:27:59 +01:00
add api for themes
This commit is contained in:
parent
a3a6f9bd7b
commit
d5cf9aeb9d
2 changed files with 13 additions and 0 deletions
11
lib/philomena_web/controllers/api/json/theme_controller.ex
Normal file
11
lib/philomena_web/controllers/api/json/theme_controller.ex
Normal 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
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue