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

25 lines
571 B
Elixir

defmodule EventosWeb.GroupView do
@moduledoc """
View for Groups
"""
use EventosWeb, :view
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
end