X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/7f611b295f39b8c42219a5ce6c84582db74ce8f7..dc60d78cdabc06b3c2fe8cb923125a01fa6b3da6:/app/controllers/api/changeset_comments_controller.rb 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