Skip to content

Commit

Permalink
fix: mentor profile page (#205)
Browse files Browse the repository at this point in the history
  • Loading branch information
ruilopesm authored Oct 10, 2023
1 parent c9bb38c commit 00ba0ca
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lib/bokken_web/views/mentor_view.ex
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ defmodule BokkenWeb.MentorView do
use BokkenWeb, :view

alias Bokken.Uploaders.Avatar
alias BokkenWeb.{MentorView, SkillView}
alias BokkenWeb.MentorView
alias BokkenWeb.SkillJSON

def render("index.json", %{mentors: mentors, current_user: current_user}) do
%{data: render_many(mentors, MentorView, "mentor.json", current_user: current_user)}
Expand Down Expand Up @@ -53,7 +54,7 @@ defmodule BokkenWeb.MentorView do

defp skills(mentor) do
if Ecto.assoc_loaded?(mentor.skills) do
%{skills: render_many(mentor.skills, SkillView, "skill.json")}
%{skills: for(skill <- mentor.skills, do: SkillJSON.data(skill))}
else
%{}
end
Expand Down

0 comments on commit 00ba0ca

Please sign in to comment.