mirror of
https://github.com/philomena-dev/philomena.git
synced 2025-02-01 03:46:44 +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]
|
resources "/posts", Forum.Topic.PostController, only: [:show, :index]
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
resources "/themes", ThemeController, only: [:index]
|
||||||
end
|
end
|
||||||
|
|
||||||
scope "/", PhilomenaWeb do
|
scope "/", PhilomenaWeb do
|
||||||
|
|
Loading…
Reference in a new issue