Change models, new migrations, fix front and make tests work

Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
Thomas Citharel
2018-01-13 23:33:03 +01:00
parent 92d2045735
commit 20cd1bb579
186 changed files with 2982 additions and 3214 deletions

View File

@@ -1,7 +1,24 @@
defmodule EventosWeb.SessionView do
use EventosWeb, :view
alias EventosWeb.SessionView
def render("token.json", %{token: token, user: user}) do
%{token: token, user: render_one(user, EventosWeb.UserView, "user.json")}
def render("index.json", %{sessions: sessions}) do
%{data: render_many(sessions, SessionView, "session.json")}
end
def render("show.json", %{session: session}) do
%{data: render_one(session, SessionView, "session.json")}
end
def render("session.json", %{session: session}) do
%{id: session.id,
title: session.title,
subtitle: session.subtitle,
short_abstract: session.short_abstract,
long_abstract: session.long_abstract,
language: session.language,
slides_url: session.slides_url,
videos_urls: session.videos_urls,
audios_urls: session.audios_urls}
end
end