mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-01-31 21:37:16 +00:00
Add missing method and skip_authorization_check to taxons controller
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user