app/controllers/spree/api/orders_controller.rb in spree_api-2.0.6 vs app/controllers/spree/api/orders_controller.rb in spree_api-2.0.7
- old
+ new
@@ -56,9 +56,11 @@
end
def sanitize_line_items(line_item_attributes)
return {} if line_item_attributes.blank?
line_item_attributes = line_item_attributes.map do |id, attributes|
+ attributes ||= id
+
# Faux Strong-Parameters code to strip price if user isn't an admin
if current_api_user.has_spree_role?("admin")
[id, attributes.slice(*Spree::LineItem.attr_accessible[:api])]
else
[id, attributes.slice(*Spree::LineItem.attr_accessible[:default])]