Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
Thomas Citharel
2018-05-18 09:56:21 +02:00
parent e14007bac5
commit f1cb601b46
39 changed files with 1289 additions and 1028 deletions

View File

@@ -3,7 +3,7 @@ defmodule EventosWeb.EventView do
View for Events
"""
use EventosWeb, :view
alias EventosWeb.{EventView, AccountView, GroupView, AddressView}
alias EventosWeb.{EventView, ActorView, GroupView, AddressView}
def render("index.json", %{events: events}) do
%{data: render_many(events, EventView, "event_simple.json")}
@@ -32,9 +32,9 @@ defmodule EventosWeb.EventView do
description: event.description,
begins_on: event.begins_on,
ends_on: event.ends_on,
organizer: render_one(event.organizer_account, AccountView, "acccount_basic.json"),
organizer: render_one(event.organizer_actor, ActorView, "acccount_basic.json"),
group: render_one(event.organizer_group, GroupView, "group_basic.json"),
participants: render_many(event.participants, AccountView, "show_basic.json"),
participants: render_many(event.participants, ActorView, "show_basic.json"),
address: render_one(event.address, AddressView, "address.json"),
}
end