2018-08-01 14:45:18 +02:00
|
|
|
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
|
2018-08-03 10:19:28 +02:00
|
|
|
%{id: follower.id, approved: follower.approved, score: follower.score}
|
2018-08-01 14:45:18 +02:00
|
|
|
end
|
|
|
|
end
|