Add missing method and skip_authorization_check to taxons controller

This commit is contained in:
luisramos0
2019-08-14 18:29:09 +01:00
parent ece0652ca3
commit 45bdb85bf3

View File

@@ -2,7 +2,7 @@ module Api
class TaxonsController < Api::BaseController
respond_to :json
skip_authorization_check only: :index
skip_authorization_check only: [:index, :show, :jstree]
def index
if taxonomy
@@ -19,7 +19,7 @@ module Api
def show
@taxon = taxon
respond_with(@taxon)
render json: @taxon, serializer: Api::TaxonSerializer
end
def jstree
@@ -32,5 +32,9 @@ module Api
return if params[:taxonomy_id].blank?
@taxonomy ||= Spree::Taxonomy.find(params[:taxonomy_id])
end
def taxon
@taxon ||= taxonomy.taxons.find(params[:id])
end
end
end