Update
This commit is contained in:
parent
188bc08494
commit
4af88f3e1d
44 changed files with 1041 additions and 34 deletions
|
@ -1,35 +0,0 @@
|
|||
defmodule NullaWeb.RelationJSON do
|
||||
alias Nulla.Relations.Relation
|
||||
|
||||
@doc """
|
||||
Renders a list of relations.
|
||||
"""
|
||||
def index(%{relations: relations}) do
|
||||
%{data: for(relation <- relations, do: data(relation))}
|
||||
end
|
||||
|
||||
@doc """
|
||||
Renders a single relation.
|
||||
"""
|
||||
def show(%{relation: relation}) do
|
||||
%{data: data(relation)}
|
||||
end
|
||||
|
||||
defp data(%Relation{} = relation) do
|
||||
%{
|
||||
id: relation.id,
|
||||
following: relation.following,
|
||||
followed_by: relation.followed_by,
|
||||
showing_replies: relation.showing_replies,
|
||||
showings_reblogs: relation.showings_reblogs,
|
||||
notifying: relation.notifying,
|
||||
muting: relation.muting,
|
||||
muting_notifications: relation.muting_notifications,
|
||||
blocking: relation.blocking,
|
||||
blocked_by: relation.blocked_by,
|
||||
domain_blocking: relation.domain_blocking,
|
||||
requested: relation.requested,
|
||||
note: relation.note
|
||||
}
|
||||
end
|
||||
end
|
Loading…
Add table
Add a link
Reference in a new issue