Sha256: 610708c785d6ab4e50c2033e51578062199e97711b87066edd187910e415bd68

Contents?: true

Size: 735 Bytes

Versions: 10

Compression:

Stored size: 735 Bytes

Contents

module Spree
  module Api
    module V2
      module Platform
        class ProductsController < ResourceController
          include ::Spree::Api::V2::ProductListIncludes

          private

          def model_class
            Spree::Product
          end

          def scope_includes
            product_list_includes
          end

          def allowed_sort_attributes
            super << :available_on
          end

          def sorted_collection
            collection_sorter.new(collection, current_currency, params, allowed_sort_attributes).call
          end

          def collection_sorter
            Spree::Api::Dependencies.platform_products_sorter.constantize
          end
        end
      end
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

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