mobilizon/lib/eventos_web/views/member_view.ex
Thomas Citharel 1217361b6c fix some code style and add checks to ci
Signed-off-by: Thomas Citharel <tcit@tcit.fr>
2018-01-14 17:57:25 +01:00

21 lines
471 B
Elixir

defmodule EventosWeb.MemberView do
@moduledoc """
View for Members
"""
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