Sha256: 2805b714700556f67c6ff35220aed33e2b96d87d9a91eebba79dbcf3da313bdf

Contents?: true

Size: 650 Bytes

Versions: 7

Compression:

Stored size: 650 Bytes

Contents

module Spree
  module Api
    module V2
      module Platform
        class TaxonsController < ResourceController
          private

          def model_class
            Spree::Taxon
          end

          def scope_includes
            node_includes = %i[icon parent taxonomy]

            {
              parent: node_includes,
              children: node_includes,
              taxonomy: [root: node_includes],
              icon: [attachment_attachment: :blob]
            }
          end

          def serializer_params
            super.merge(include_products: action_name == 'show')
          end
        end
      end
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
spree_api-4.3.3 app/controllers/spree/api/v2/platform/taxons_controller.rb
spree_api-4.3.2 app/controllers/spree/api/v2/platform/taxons_controller.rb
spree_api-4.3.1 app/controllers/spree/api/v2/platform/taxons_controller.rb
spree_api-4.3.0 app/controllers/spree/api/v2/platform/taxons_controller.rb
spree_api-4.3.0.rc3 app/controllers/spree/api/v2/platform/taxons_controller.rb
spree_api-4.3.0.rc2 app/controllers/spree/api/v2/platform/taxons_controller.rb
spree_api-4.3.0.rc1 app/controllers/spree/api/v2/platform/taxons_controller.rb