Sha256: 26e6fa64c10c703f99d3564d6cd8795ccf08a63e1eb4c799f7a95b88a4e9da57

Contents?: true

Size: 592 Bytes

Versions: 11

Compression:

Stored size: 592 Bytes

Contents

module Spree
  module Api
    module V1
      class ClassificationsController < Spree::Api::BaseController
        def update
          authorize! :update, Product
          authorize! :update, Taxon
          classification = Spree::Classification.find_by(
            product_id: params[:product_id],
            taxon_id: params[:taxon_id]
          )
          Spree::Dependencies.classification_reposition_service.constantize.call(
            classification: classification,
            position: params[:position]
          )
          head :ok
        end
      end
    end
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

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