Class: FlowcommerceSpree::InventoryController
- Inherits:
-
ActionController::Base
- Object
- ActionController::Base
- FlowcommerceSpree::InventoryController
- Defined in:
- app/controllers/flowcommerce_spree/inventory_controller.rb
Instance Method Summary collapse
Instance Method Details
#online_stock_availability ⇒ Object
5 6 7 8 9 |
# File 'app/controllers/flowcommerce_spree/inventory_controller.rb', line 5 def online_stock_availability items = params['items'] || [] response = items.inject([]) { |result, item| result << check_stock(item[:id], item[:qty].to_i) } render json: { items: response }, status: :ok end |