Forgot to prepend to the avatar_url path

This commit is contained in:
Byron Mulvogue 2020-03-03 05:23:44 +00:00
parent 297e0909d6
commit 0ae05b97b2

View file

@ -10,7 +10,7 @@ defmodule PhilomenaWeb.UserJson do
slug: user.slug, slug: user.slug,
role: role(user), role: role(user),
description: user.description, description: user.description,
avatar_url: user.avatar, avatar_url: avatar_url_root() <> "/" <> user.avatar,
created_at: user.created_at, created_at: user.created_at,
comments_count: user.comments_posted_count, comments_count: user.comments_posted_count,
uploads_count: user.uploads_count, uploads_count: user.uploads_count,
@ -28,4 +28,8 @@ defmodule PhilomenaWeb.UserJson do
defp role(user) do defp role(user) do
user.role user.role
end end
defp avatar_url_root do
Application.get_env(:philomena, :avatar_url_root)
end
end end