]> git.openstreetmap.org Git - rails.git/blobdiff - app/controllers/api/changesets_controller.rb
Refactor api controllers to inherit from a common ApiController
[rails.git] / app / controllers / api / changesets_controller.rb
index 92690a75ec36f671a8ee34178899b4d7c74e98a8..0f016c9025d5e8dca63d2705658aab3b3aebd726 100644 (file)
@@ -1,11 +1,10 @@
 # The ChangesetController is the RESTful interface to Changeset objects
 
 module Api
-  class ChangesetsController < ApplicationController
+  class ChangesetsController < ApiController
     layout "site"
     require "xml/libxml"
 
-    skip_before_action :verify_authenticity_token
     before_action :authorize, :only => [:create, :update, :upload, :close, :subscribe, :unsubscribe]
     before_action :api_deny_access_handler, :only => [:create, :update, :upload, :close, :subscribe, :unsubscribe, :expand_bbox]
 
@@ -43,7 +42,7 @@ module Api
     def show
       @changeset = Changeset.find(params[:id])
       @include_discussion = params[:include_discussion].presence
-      render "changesets/changeset"
+      render "changeset"
     end
 
     ##
@@ -105,7 +104,7 @@ module Api
       # will include the bigger bounding box.
       cs.save!
       @changeset = cs
-      render "changesets/changeset"
+      render "changeset"
     end
 
     ##
@@ -222,7 +221,7 @@ module Api
 
       # preload users, tags and comments, and render result
       @changesets = changesets.preload(:user, :changeset_tags, :comments)
-      render "changesets/changesets"
+      render "changesets"
     end
 
     ##
@@ -242,7 +241,7 @@ module Api
 
       check_changeset_consistency(@changeset, current_user)
       @changeset.update_from(new_changeset, current_user)
-      render "changesets/changeset"
+      render "changeset"
     end
 
     ##
@@ -263,7 +262,7 @@ module Api
 
       # Return a copy of the updated changeset
       @changeset = changeset
-      render "changesets/changeset"
+      render "changeset"
     end
 
     ##
@@ -284,7 +283,7 @@ module Api
 
       # Return a copy of the updated changeset
       @changeset = changeset
-      render "changesets/changeset"
+      render "changeset"
     end
 
     private