mobilizon.chapril.org-mobil.../lib/eventos_web/views/participant_view.ex
Thomas Citharel 979aad5acb Remove credo and use mix format, and lint everything
Signed-off-by: Thomas Citharel <tcit@tcit.fr>
2018-07-27 10:45:35 +02:00

20 lines
555 B
Elixir

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