add edit timestamp, edit reason to post and comment json

This commit is contained in:
byte[] 2020-03-31 11:09:44 -04:00
parent 051a819c9c
commit 724b3a97b1
2 changed files with 24 additions and 6 deletions

View file

@ -25,7 +25,9 @@ defmodule PhilomenaWeb.Api.Json.CommentView do
author: nil,
body: nil,
created_at: nil,
updated_at: nil
updated_at: nil,
edited_at: nil,
edit_reason: nil
}
end
@ -41,7 +43,9 @@ defmodule PhilomenaWeb.Api.Json.CommentView do
),
body: nil,
created_at: comment.created_at,
updated_at: comment.updated_at
updated_at: comment.updated_at,
edited_at: nil,
edit_reason: nil
}
end
@ -57,7 +61,9 @@ defmodule PhilomenaWeb.Api.Json.CommentView do
),
body: comment.body,
created_at: comment.created_at,
updated_at: comment.updated_at
updated_at: comment.updated_at,
edited_at: comment.edited_at,
edit_reason: comment.edit_reason
}
end
end

View file

@ -18,7 +18,11 @@ defmodule PhilomenaWeb.Api.Json.Forum.Topic.PostView do
id: post.id,
user_id: nil,
author: nil,
body: nil
body: nil,
created_at: nil,
updated_at: nil,
edited_at: nil,
edit_reason: nil
}
end
@ -31,7 +35,11 @@ defmodule PhilomenaWeb.Api.Json.Forum.Topic.PostView do
do: UserAttributionView.anonymous_name(post),
else: post.user.name
),
body: nil
body: nil,
created_at: post.created_at,
updated_at: post.updated_at,
edited_at: nil,
edit_reason: nil
}
end
@ -44,7 +52,11 @@ defmodule PhilomenaWeb.Api.Json.Forum.Topic.PostView do
do: UserAttributionView.anonymous_name(post),
else: post.user.name
),
body: post.body
body: post.body,
created_at: post.created_at,
updated_at: post.updated_at,
edited_at: post.edited_at,
edit_reason: post.edit_reason
}
end
end