You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Current behavior
Throws an error - NoMethodError: undefined method 'each_key' for [{"variant_id"=>xx, "quantity"=>xx}] as importer expects a hash of hashes instead of an array of hashes.
@rileyanderson Hey there, I'm taking a look at this but it looks like the accepted parameters are the same for both those endpoints. We have also a spec covering your scenario.
Can you please describe the context of the error better?
Api users that have admin role cannot create an order with line items though the api. When a user has an admin role it assumes that the intent is to import an order.
https://github.com/solidusio/solidus/blob/master/api/app/controllers/spree/api/orders_controller.rb#L36-L38
Solidus Version:
Master
To Reproduce
Current behavior
Throws an error -
NoMethodError: undefined method 'each_key' for [{"variant_id"=>xx, "quantity"=>xx}]
as importer expects a hash of hashes instead of an array of hashes.https://github.com/solidusio/solidus/blob/master/core/lib/spree/core/importer/order.rb#L99-L112
Expected behavior
Should not call importer in this instance. Ideally importer would be a separate endpoint.
The text was updated successfully, but these errors were encountered: