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

client - user account page done

This commit is contained in:
2018-01-13 00:31:01 -06:00
parent 57663b802c
commit e9d46ed5ce
12 changed files with 306 additions and 110 deletions

View File

@@ -45,7 +45,12 @@ defmodule MyApp.BattleNet.User do
defp parse_character_response({:ok, %HTTPoison.Response{body: body}}, user_id) do
case Poison.decode(body) do
{:ok, data} ->
Cachex.set(:myapp, "usr_char:#{user_id}", data, ttl: :timer.minutes(10)) # 10 minutes
# only cache end point if characters return
if (!data["characters"]) do
{:error, data}
else
Cachex.set(:myapp, "usr_char:#{user_id}", data, ttl: :timer.minutes(10)) # 10 minutes
end
{:ok, data}
{:error, error} -> {:error, error}
end

View File

@@ -70,8 +70,8 @@ defmodule MyApp.Data.Thread do
:title,
:view_count,
:reply_count,
user: [:id, :battletag],
last_reply: [:id, :battletag],
user: [:id, :battletag, :character_guild, :character_name, :character_class, :character_realm, :character_avatar],
last_reply: [:id, :battletag, :character_guild, :character_name, :character_class, :character_realm, :character_avatar],
]),
where: [category_id: ^category_id],
preload: [:user, :last_reply]