debianize-mobilizon/lib/eventos_web/views/track_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
499 B
Elixir

defmodule EventosWeb.TrackView do
@moduledoc """
View for Tracks
"""
use EventosWeb, :view
alias EventosWeb.TrackView
def render("index.json", %{tracks: tracks}) do
%{data: render_many(tracks, TrackView, "track.json")}
end
def render("show.json", %{track: track}) do
%{data: render_one(track, TrackView, "track.json")}
end
def render("track.json", %{track: track}) do
%{id: track.id, name: track.name, description: track.description, color: track.color}
end
end