Fix list unit and supplier main board acceptance specs
This commit is contained in:
@@ -1,6 +1,8 @@
|
||||
module Users
|
||||
class OrdersController < Users::ApplicationController
|
||||
respond_to :json
|
||||
|
||||
# Used by the user Ember app
|
||||
def create
|
||||
render json: {}, status: :unprocessable_entity and return unless params[:order].present? && params[:order][:product_orders].present?
|
||||
converted_order = params[:order][:product_orders].each_with_object({}){|po, o| o[po[:product_id]] = po[:quantity] }
|
||||
@@ -18,7 +20,7 @@ module Users
|
||||
|
||||
list = List.from_table( table, current_user )
|
||||
end
|
||||
order = list.place_order converted_order
|
||||
order = list.place_order products: converted_order, user: current_user
|
||||
render json: order, serializer: OrderSerializer
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user