From 78ab8521412cee67ca115af1d8e881d5641eba63 Mon Sep 17 00:00:00 2001 From: luisramos0 Date: Wed, 31 Jul 2019 11:23:43 +0100 Subject: [PATCH] Make spree/api/products_controller work with AMS --- app/controllers/spree/api/products_controller.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/controllers/spree/api/products_controller.rb b/app/controllers/spree/api/products_controller.rb index b8d7f81a44..dacd6b6948 100644 --- a/app/controllers/spree/api/products_controller.rb +++ b/app/controllers/spree/api/products_controller.rb @@ -2,9 +2,11 @@ require 'open_food_network/permissions' module Spree module Api - class ProductsController < Spree::Api::BaseController + class ProductsController < ::Api::BaseController respond_to :json + skip_authorization_check only: [:show] + def show @product = find_product(params[:id]) render json: @product, serializer: ::Api::Admin::ProductSerializer