Introduce follower, add tests
Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
@@ -13,8 +13,7 @@ defmodule EventosWeb.ActivityPub.ActorView do
|
||||
import Ecto.Query
|
||||
|
||||
def render("actor.json", %{actor: actor}) do
|
||||
pem = Actor.get_keys_for_actor(actor)
|
||||
public_key = Eventos.Service.ActivityPub.Utils.pem_to_public_key_pem(pem)
|
||||
public_key = Eventos.Service.ActivityPub.Utils.pem_to_public_key_pem(actor.keys)
|
||||
|
||||
%{
|
||||
"id" => actor.url,
|
||||
|
||||
18
lib/eventos_web/views/follower_view.ex
Normal file
18
lib/eventos_web/views/follower_view.ex
Normal 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
|
||||
Reference in New Issue
Block a user