2018-01-13 23:33:03 +01:00
|
|
|
defmodule EventosWeb.MemberView do
|
2018-01-14 17:56:50 +01:00
|
|
|
@moduledoc """
|
|
|
|
View for Members
|
|
|
|
"""
|
2018-01-13 23:33:03 +01:00
|
|
|
use EventosWeb, :view
|
|
|
|
alias EventosWeb.MemberView
|
|
|
|
|
|
|
|
def render("index.json", %{members: members}) do
|
|
|
|
%{data: render_many(members, MemberView, "member.json")}
|
|
|
|
end
|
|
|
|
|
|
|
|
def render("show.json", %{member: member}) do
|
|
|
|
%{data: render_one(member, MemberView, "member.json")}
|
|
|
|
end
|
|
|
|
|
|
|
|
def render("member.json", %{member: member}) do
|
|
|
|
%{id: member.id,
|
|
|
|
role: member.role}
|
|
|
|
end
|
|
|
|
end
|