debianize-mobilizon/lib/eventos_web/views/participant_view.ex
Thomas Citharel 20cd1bb579 Change models, new migrations, fix front and make tests work
Signed-off-by: Thomas Citharel <tcit@tcit.fr>
2018-01-13 23:33:03 +01:00

18 lines
514 B
Elixir

defmodule EventosWeb.ParticipantView do
use EventosWeb, :view
alias EventosWeb.ParticipantView
def render("index.json", %{participants: participants}) do
%{data: render_many(participants, ParticipantView, "participant.json")}
end
def render("show.json", %{participant: participant}) do
%{data: render_one(participant, ParticipantView, "participant.json")}
end
def render("participant.json", %{participant: participant}) do
%{id: participant.id,
role: participant.role}
end
end