Introduce follower, add tests

Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
Thomas Citharel
2018-08-01 14:45:18 +02:00
parent 979aad5acb
commit 115d1d1a3e
15 changed files with 477 additions and 138 deletions

View File

@@ -0,0 +1,18 @@
defmodule EventosWeb.FollowerView do
use EventosWeb, :view
alias EventosWeb.FollowerView
def render("index.json", %{followers: followers}) do
%{data: render_many(followers, FollowerView, "follower.json")}
end
def render("show.json", %{follower: follower}) do
%{data: render_one(follower, FollowerView, "follower.json")}
end
def render("follower.json", %{follower: follower}) do
%{id: follower.id,
approved: follower.approved,
score: follower.score}
end
end