Skip to content

Commit

Permalink
fix view rendering bug
Browse files Browse the repository at this point in the history
  • Loading branch information
danielsp45 committed Dec 14, 2023
1 parent 1e6d522 commit cbb79be
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/bokken_web/controllers/guardian_json.ex
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ defmodule BokkenWeb.GuardianJSON do
%{data: data(guardian, current_user)}
end

defp data(guardian, current_user) do
def data(guardian, current_user) do
guardian(guardian)
|> Map.merge(personal(guardian, current_user))
end
Expand Down
2 changes: 1 addition & 1 deletion lib/bokken_web/views/auth_view.ex
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ defmodule BokkenWeb.AuthView do
end

def render("me.json", %{user: %{role: :guardian, guardian: guardian} = user}) do
render_one(guardian, GuardianJSON, :show, current_user: user)
GuardianJSON.data(guardian, user)
|> Map.merge(render_one(user, AuthView, "user.json", current_user: user))
|> Map.put(:guardian_id, guardian.id)
end
Expand Down

0 comments on commit cbb79be

Please sign in to comment.