Add timestamps to the API's comment view (#67)

* Add timestamps to the API's comment view

* Change property name to created_at
This commit is contained in:
Neil McAlister 2020-03-31 18:04:06 +03:00 committed by GitHub
parent 0b0a5b1b42
commit 051a819c9c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -23,7 +23,9 @@ defmodule PhilomenaWeb.Api.Json.CommentView do
image_id: comment.image_id, image_id: comment.image_id,
user_id: nil, user_id: nil,
author: nil, author: nil,
body: nil body: nil,
created_at: nil,
updated_at: nil
} }
end end
@ -37,7 +39,9 @@ defmodule PhilomenaWeb.Api.Json.CommentView do
do: UserAttributionView.anonymous_name(comment), do: UserAttributionView.anonymous_name(comment),
else: comment.user.name else: comment.user.name
), ),
body: nil body: nil,
created_at: comment.created_at,
updated_at: comment.updated_at
} }
end end
@ -51,7 +55,9 @@ defmodule PhilomenaWeb.Api.Json.CommentView do
do: UserAttributionView.anonymous_name(comment), do: UserAttributionView.anonymous_name(comment),
else: comment.user.name else: comment.user.name
), ),
body: comment.body body: comment.body,
created_at: comment.created_at,
updated_at: comment.updated_at
} }
end end
end end