Sha256: 55dec25711c711e46e46b79c11493b9cd1ef6c5c5854738b650ea6756dc6c7a4

Contents?: true

Size: 402 Bytes

Versions: 2

Compression:

Stored size: 402 Bytes

Contents

module Spree
  module Api
    module V2
      class OrdersController < Spree::Api::V2::BaseController
        def index
          render_collection orders
        end

        def show
          render_instance orders.find(params[:id])
        end

        private

        def orders
          @current_api_user.admin? ? Spree::Order : @current_api_user.orders
        end
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
solidus_json_api-0.3.1 app/controllers/spree/api/v2/orders_controller.rb
solidus_json_api-0.3.0 app/controllers/spree/api/v2/orders_controller.rb