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,15 +1,39 @@
defmodule EventosWeb.AccountView do
use EventosWeb, :view
alias EventosWeb.AccountView
def render("account.json", %{"account": account}) do
%{
def render("index.json", %{accounts: accounts}) do
%{data: render_many(accounts, AccountView, "account_for_user.json")}
end
def render("show.json", %{account: account}) do
%{data: render_one(account, AccountView, "account.json")}
end
def render("account_for_user.json", %{account: account}) do
%{id: account.id,
username: account.username,
description: account.description,
display_name: account.display_name,
domain: account.domain,
display_name: account.display_name,
description: account.description,
public_key: account.public_key,
suspended: account.suspended,
uri: account.uri,
url: account.url,
}
end
def render("account.json", %{account: account}) do
%{id: account.id,
username: account.username,
domain: account.domain,
display_name: account.display_name,
description: account.description,
public_key: account.public_key,
suspended: account.suspended,
uri: account.uri,
url: account.url,
organized_events: account.organized_events
}
end
end