From 051a819c9c06337a5deef1869110e64b6445dde7 Mon Sep 17 00:00:00 2001 From: Neil McAlister Date: Tue, 31 Mar 2020 18:04:06 +0300 Subject: [PATCH] Add timestamps to the API's comment view (#67) * Add timestamps to the API's comment view * Change property name to created_at --- lib/philomena_web/views/api/json/comment_view.ex | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/lib/philomena_web/views/api/json/comment_view.ex b/lib/philomena_web/views/api/json/comment_view.ex index 2023f7c7..5d40340b 100644 --- a/lib/philomena_web/views/api/json/comment_view.ex +++ b/lib/philomena_web/views/api/json/comment_view.ex @@ -23,7 +23,9 @@ defmodule PhilomenaWeb.Api.Json.CommentView do image_id: comment.image_id, user_id: nil, author: nil, - body: nil + body: nil, + created_at: nil, + updated_at: nil } end @@ -37,7 +39,9 @@ defmodule PhilomenaWeb.Api.Json.CommentView do do: UserAttributionView.anonymous_name(comment), else: comment.user.name ), - body: nil + body: nil, + created_at: comment.created_at, + updated_at: comment.updated_at } end @@ -51,7 +55,9 @@ defmodule PhilomenaWeb.Api.Json.CommentView do do: UserAttributionView.anonymous_name(comment), else: comment.user.name ), - body: comment.body + body: comment.body, + created_at: comment.created_at, + updated_at: comment.updated_at } end end