X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/5047ec403db94b0d371a9a10b56801bc0a3fcf0a..bdf3abeb07354e6424e8ed892ef48bbb6b823ea6:/app/controllers/api/changeset_comments_controller.rb?ds=inline diff --git a/app/controllers/api/changeset_comments_controller.rb b/app/controllers/api/changeset_comments_controller.rb index c180571c5..808ac97ea 100644 --- a/app/controllers/api/changeset_comments_controller.rb +++ b/app/controllers/api/changeset_comments_controller.rb @@ -1,7 +1,9 @@ module Api class ChangesetCommentsController < ApiController - before_action :check_api_writable - before_action :authorize + include QueryMethods + + before_action :check_api_writable, :except => [:index] + before_action :authorize, :except => [:index] authorize_resource @@ -9,6 +11,15 @@ module Api before_action :set_request_formats + ## + # show all comments or search for a subset + def index + @comments = ChangesetComment.includes(:author).where(:visible => true).order("created_at DESC") + @comments = query_conditions_time(@comments) + @comments = query_conditions_user(@comments, :author) + @comments = query_limit(@comments) + end + ## # Add a comment to a changeset def create