X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/b5f06e06c14f440d3c014b348149fe9ec1b67657..32104684f7fe70bac494ede1f7249a6cf19a63ec:/app/controllers/api/changesets_controller.rb diff --git a/app/controllers/api/changesets_controller.rb b/app/controllers/api/changesets_controller.rb index df27ab5ca..24e7fb925 100644 --- a/app/controllers/api/changesets_controller.rb +++ b/app/controllers/api/changesets_controller.rb @@ -4,14 +4,14 @@ module Api class ChangesetsController < ApiController require "xml/libxml" + before_action :check_api_writable, :only => [:create, :update, :upload, :subscribe, :unsubscribe] + before_action :check_api_readable, :except => [:create, :update, :upload, :download, :query, :subscribe, :unsubscribe] before_action :authorize, :only => [:create, :update, :upload, :close, :subscribe, :unsubscribe] authorize_resource before_action :require_public_data, :only => [:create, :update, :upload, :close, :subscribe, :unsubscribe] - before_action :check_api_writable, :only => [:create, :update, :upload, :subscribe, :unsubscribe] - before_action :check_api_readable, :except => [:create, :update, :upload, :download, :query, :subscribe, :unsubscribe] - before_action :set_request_formats, :only => [:download] + before_action :set_request_formats, :except => [:create, :close, :upload] around_action :api_call_handle_error around_action :api_call_timeout, :except => [:upload] @@ -42,6 +42,11 @@ module Api @changeset = Changeset.find(params[:id]) @include_discussion = params[:include_discussion].presence render "changeset" + + respond_to do |format| + format.xml + format.json + end end ## @@ -171,6 +176,11 @@ module Api # preload users, tags and comments, and render result @changesets = changesets.preload(:user, :changeset_tags, :comments) render "changesets" + + respond_to do |format| + format.xml + format.json + end end ## @@ -191,6 +201,11 @@ module Api check_changeset_consistency(@changeset, current_user) @changeset.update_from(new_changeset, current_user) render "changeset" + + respond_to do |format| + format.xml + format.json + end end ## @@ -212,6 +227,11 @@ module Api # Return a copy of the updated changeset @changeset = changeset render "changeset" + + respond_to do |format| + format.xml + format.json + end end ## @@ -233,6 +253,11 @@ module Api # Return a copy of the updated changeset @changeset = changeset render "changeset" + + respond_to do |format| + format.xml + format.json + end end private