2018-01-13 23:33:03 +01:00
|
|
|
defmodule EventosWeb.TrackView do
|
2018-01-14 17:56:50 +01:00
|
|
|
@moduledoc """
|
|
|
|
View for Tracks
|
|
|
|
"""
|
2018-01-13 23:33:03 +01:00
|
|
|
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
|