diff --git a/app/controllers/enterprises_controller.rb b/app/controllers/enterprises_controller.rb index e33a10a296..ebc139c461 100644 --- a/app/controllers/enterprises_controller.rb +++ b/app/controllers/enterprises_controller.rb @@ -17,15 +17,11 @@ class EnterprisesController < BaseController return redirect_to spree.cart_path unless enough_stock? set_noindex_meta_tag - enterprises = current_distributor + @enterprises = current_distributor .plus_relatives_and_oc_producers(shop_order_cycles) .activated .includes(address: :state) .all - - enterprises = inject_json_ams('enterprises', enterprises) - - render locals: { enterprises: enterprises } end def relatives @@ -111,14 +107,4 @@ class EnterprisesController < BaseController def set_noindex_meta_tag @noindex_meta_tag = true unless current_distributor.visible? end - - def inject_json_ams(name, object) - options = { - each_serializer: Api::EnterpriseSerializer, - data: OpenFoodNetwork::EnterpriseInjectionData.new - } - serializer_instance = ActiveModel::ArraySerializer.new(object, options) - - { name: name, json: serializer_instance.to_json } - end end diff --git a/app/views/enterprises/shop.html.haml b/app/views/enterprises/shop.html.haml index 041c8be07b..ed27346d2d 100644 --- a/app/views/enterprises/shop.html.haml +++ b/app/views/enterprises/shop.html.haml @@ -5,7 +5,7 @@ - content_for(:image) do = current_distributor.logo.url -= render partial: 'json/injection_ams', locals: enterprises += inject_enterprises(@enterprises) %shop.darkswarm - if @shopfront_layout == 'embedded'