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!
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
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
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!
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