Add changeset comment search api with filtering by author and time

This commit is contained in:
Anton Khorev 2023-11-16 10:03:26 +03:00
parent bd278a07fe
commit 1f59507e78
8 changed files with 91 additions and 14 deletions

View file

@ -27,18 +27,7 @@ xml.changeset(attrs) do |changeset_xml_node|
if @comments
changeset_xml_node.discussion do |discussion_xml_node|
@comments.each do |comment|
cattrs = {
"id" => comment.id,
"date" => comment.created_at.xmlschema,
"visible" => comment.visible
}
if comment.author.data_public?
cattrs["uid"] = comment.author.id
cattrs["user"] = comment.author.display_name
end
discussion_xml_node.comment(cattrs) do |comment_xml_node|
comment_xml_node.text(comment.body)
end
discussion_xml_node << render(comment)
end
end
end