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

23 lines
517 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