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