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:
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user