1
0
mirror of https://github.com/mgerb/classic-wow-forums synced 2026-01-12 01:52:49 +00:00

character list end point

This commit is contained in:
2018-01-01 19:20:17 -06:00
parent 135ce3a5d6
commit e77288d40e
3 changed files with 34 additions and 2 deletions

View File

@@ -22,4 +22,19 @@ defmodule MyAppWeb.BattleNetController do
|>Response.json(output)
end
# TODO: cache this end point
def characters(conn, _params) do
token = conn
|> MyApp.Guardian.Plug.current_claims
|> Map.get("access_token")
{output, status} = token
|> BattleNet.User.get_user_characters
|> Response.put_resp
conn
|>put_status(status)
|>Response.json(output)
end
end

View File

@@ -16,6 +16,9 @@ defmodule MyAppWeb.Router do
scope "/battlenet" do
get "/authorize", BattleNetController, :authorize
pipe_through [:api_auth]
get "/characters", BattleNetController, :characters
end
scope "/user" do