Make edits return version numbers as plain text strings

This commit is contained in:
Christopher Schmidt 2008-05-11 19:47:19 +00:00
parent 013ef53c97
commit 7a216c0ce6
3 changed files with 7 additions and 6 deletions

View file

@ -15,7 +15,7 @@ class NodeController < ApplicationController
node = Node.from_xml(request.raw_post, true)
if node
node.version = 0
node.version = 0
node.user_id = @user.id
node.visible = true
node.save_with_history!
@ -51,8 +51,8 @@ class NodeController < ApplicationController
new_node = Node.from_xml(request.raw_post)
if new_node and new_node.id == node.id
node.update_from(new_node, @user)
render :nothing => true
node.update_from(new_node, @user)
render :text => node.version.to_s, :content_type => "text/plain"
else
render :nothing => true, :status => :bad_request
end

View file

@ -52,6 +52,7 @@ class RelationController < ApplicationController
if new_relation and new_relation.id == relation.id
relation.update_from new_relation, user
render :text => relation.version.to_s, :content_type => "text/plain"
else
render :nothing => true, :status => :bad_request
end

View file

@ -15,7 +15,7 @@ class WayController < ApplicationController
if !way.preconditions_ok?
render :text => "", :status => :precondition_failed
else
way.version = 0
way.version = 0
way.user_id = @user.id
way.save_with_history!
@ -51,8 +51,8 @@ class WayController < ApplicationController
new_way = Way.from_xml(request.raw_post)
if new_way and new_way.id == way.id
way.update_from(new_way, @user)
render :nothing => true
way.update_from(new_way, @user)
render :text => way.version.to_s, :content_type => "text/plain"
else
render :nothing => true, :status => :bad_request
end