diff --git a/app/controllers/api/order_cycles_controller.rb b/app/controllers/api/order_cycles_controller.rb index ddc7b15fa5..bc1bba3d5a 100644 --- a/app/controllers/api/order_cycles_controller.rb +++ b/app/controllers/api/order_cycles_controller.rb @@ -20,7 +20,7 @@ module Api search_params ).products_json - render plain: products, content_type: "application/json" + render plain: products rescue ProductsRenderer::NoProducts render_no_products end @@ -33,13 +33,13 @@ module Api render plain: ActiveModel::ArraySerializer.new( taxons, each_serializer: Api::TaxonSerializer - ).to_json, content_type: "application/json" + ).to_json end def properties render plain: ActiveModel::ArraySerializer.new( product_properties | producer_properties, each_serializer: Api::PropertySerializer - ).to_json, content_type: "application/json" + ).to_json end private