debianize-mobilizon/lib/eventos_web/views/comment_view.ex
Thomas Citharel ca36dd12e2
Make tests great again !
(Also use only one field for public/private key pem)
Signed-off-by: Thomas Citharel <tcit@tcit.fr>
2018-06-14 17:25:55 +02:00

21 lines
501 B
Elixir

defmodule EventosWeb.CommentView do
use EventosWeb, :view
alias EventosWeb.CommentView
def render("index.json", %{comments: comments}) do
%{data: render_many(comments, CommentView, "comment.json")}
end
def render("show.json", %{comment: comment}) do
%{data: render_one(comment, CommentView, "comment.json")}
end
def render("comment.json", %{comment: comment}) do
%{id: comment.id,
uuid: comment.uuid,
url: comment.url,
text: comment.text
}
end
end