2017-12-08 09:58:14 +01:00
|
|
|
defmodule EventosWeb.GroupView do
|
|
|
|
use EventosWeb, :view
|
2018-01-13 23:33:03 +01:00
|
|
|
alias EventosWeb.GroupView
|
|
|
|
|
|
|
|
def render("index.json", %{groups: groups}) do
|
|
|
|
%{data: render_many(groups, GroupView, "group.json")}
|
|
|
|
end
|
|
|
|
|
|
|
|
def render("show.json", %{group: group}) do
|
|
|
|
%{data: render_one(group, GroupView, "group.json")}
|
|
|
|
end
|
|
|
|
|
|
|
|
def render("group.json", %{group: group}) do
|
|
|
|
%{id: group.id,
|
|
|
|
title: group.title,
|
|
|
|
description: group.description,
|
|
|
|
suspended: group.suspended,
|
|
|
|
url: group.url,
|
|
|
|
uri: group.uri}
|
|
|
|
end
|
2017-12-08 09:58:14 +01:00
|
|
|
end
|