Sha256: 25f2ff702cb8e3aa67d0d2f17563b34bf6f14c2154bf58efa328b74cbf870564

Contents?: true

Size: 531 Bytes

Versions: 8

Compression:

Stored size: 531 Bytes

Contents

module Spree
  module Api
    module V2
      class TaxonomiesController < Spree::Api::V2::BaseController
        skip_before_action :authenticate_user, only: [:index, :show]

        def index
          render_collection Spree::Taxonomy.includes(:taxons)
        end

        def show
          if params[:taxon_id].present?
            render_instance Spree::Taxon.find(params[:taxon_id]).taxonomy
          else
            render_instance Spree::Taxonomy.find(params[:id])
          end
        end
      end
    end
  end
end

Version data entries

8 entries across 8 versions & 3 rubygems

Version Path
solidus_json_api-0.3.1 app/controllers/spree/api/v2/taxonomies_controller.rb
solidus_json_api-0.3.0 app/controllers/spree/api/v2/taxonomies_controller.rb
spree_api_v2-0.2.2 app/controllers/spree/api/v2/taxonomies_controller.rb
solidus_api_v2-0.2.2 app/controllers/spree/api/v2/taxonomies_controller.rb
solidus_api_v2-0.2.1 app/controllers/spree/api/v2/taxonomies_controller.rb
spree_api_v2-0.2.1 app/controllers/spree/api/v2/taxonomies_controller.rb
spree_api_v2-0.2.0 app/controllers/spree/api/v2/taxonomies_controller.rb
solidus_api_v2-0.2.0 app/controllers/spree/api/v2/taxonomies_controller.rb