Permalink
Browse files

allow updating through orders api

  • Loading branch information...
cmar
cmar committed Apr 16, 2012
1 parent 542db21 commit ab1e23bb47bfa098ffceb0b7cbf3d2bb2d6ad500
Showing with 10 additions and 0 deletions.
  1. +10 −0 api/app/controllers/spree/api/v1/orders_controller.rb
@@ -17,6 +17,16 @@ def create
next!
end
def update
authorize! :update, Order
Rails.logger.debug params.inspect

This comment has been minimized.

Show comment
Hide comment
@radar

radar Apr 16, 2012

Member

You left a debug here.

@radar

radar Apr 16, 2012

Member

You left a debug here.

if order.update_attributes(params[:order])
render :show, :status => 200

This comment has been minimized.

Show comment
Hide comment
@radar

radar Apr 16, 2012

Member

No need to :status => 200 this, that's the default.

@radar

radar Apr 16, 2012

Member

No need to :status => 200 this, that's the default.

else
invalid_resource!(order)
end
end
def address
order.build_ship_address(params[:shipping_address])
order.build_bill_address(params[:billing_address])

2 comments on commit ab1e23b

@radar

This comment has been minimized.

Show comment
Hide comment
@radar

radar Apr 16, 2012

Member

👍 cool patch bro

Member

radar replied Apr 16, 2012

👍 cool patch bro

@cmar

This comment has been minimized.

Show comment
Hide comment
@cmar

cmar Apr 16, 2012

Member

The status 200 was copied from the ProductsController

Member

cmar replied Apr 16, 2012

The status 200 was copied from the ProductsController

Please sign in to comment.