debianize-mobilizon/lib/eventos_web/views/comment_view.ex
Thomas Citharel 979aad5acb Remove credo and use mix format, and lint everything
Signed-off-by: Thomas Citharel <tcit@tcit.fr>
2018-07-27 10:45:35 +02:00

17 lines
478 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