Sha256: 77d9afaca2f981320191f4a69a691a1c211f778d12e8b0390e298400cc56078a

Contents?: true

Size: 439 Bytes

Versions: 2

Compression:

Stored size: 439 Bytes

Contents

# frozen_string_literal: true

module Spree
  module Api
    class PromotionsController < Spree::Api::BaseController
      before_action :load_promotion

      def show
        authorize! :show, @promotion
        respond_with(@promotion, default_template: :show)
      end

      private

      def load_promotion
        @promotion = Spree::Config.promotions.promotion_finder_class.by_code_or_id(params[:id])
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
solidus_api-4.4.1 app/controllers/spree/api/promotions_controller.rb
solidus_api-4.4.0 app/controllers/spree/api/promotions_controller.rb