2017-12-08 09:58:14 +01:00
|
|
|
defmodule EventosWeb.TagView do
|
2018-01-14 17:56:50 +01:00
|
|
|
@moduledoc """
|
|
|
|
View for Tags
|
|
|
|
"""
|
2017-12-08 09:58:14 +01:00
|
|
|
use EventosWeb, :view
|
2018-01-13 23:33:03 +01:00
|
|
|
alias EventosWeb.TagView
|
|
|
|
|
|
|
|
def render("index.json", %{tags: tags}) do
|
|
|
|
%{data: render_many(tags, TagView, "tag.json")}
|
|
|
|
end
|
|
|
|
|
|
|
|
def render("show.json", %{tag: tag}) do
|
|
|
|
%{data: render_one(tag, TagView, "tag.json")}
|
|
|
|
end
|
|
|
|
|
|
|
|
def render("tag.json", %{tag: tag}) do
|
|
|
|
%{id: tag.id,
|
|
|
|
title: tag.title}
|
|
|
|
end
|
2017-12-08 09:58:14 +01:00
|
|
|
end
|