Update
This commit is contained in:
parent
188bc08494
commit
4af88f3e1d
44 changed files with 1041 additions and 34 deletions
|
@ -1,32 +0,0 @@
|
|||
defmodule NullaWeb.NoteJSON do
|
||||
alias Nulla.Notes.Note
|
||||
|
||||
@doc """
|
||||
Renders a list of notes.
|
||||
"""
|
||||
def index(%{notes: notes}) do
|
||||
%{data: for(note <- notes, do: data(note))}
|
||||
end
|
||||
|
||||
@doc """
|
||||
Renders a single note.
|
||||
"""
|
||||
def show(%{note: note}) do
|
||||
%{data: data(note)}
|
||||
end
|
||||
|
||||
defp data(%Note{} = note) do
|
||||
%{
|
||||
id: note.id,
|
||||
inReplyTo: note.inReplyTo,
|
||||
published: note.published,
|
||||
url: note.url,
|
||||
visibility: note.visibility,
|
||||
to: note.to,
|
||||
cc: note.cc,
|
||||
sensitive: note.sensitive,
|
||||
content: note.content,
|
||||
language: note.language
|
||||
}
|
||||
end
|
||||
end
|
Loading…
Add table
Add a link
Reference in a new issue