Files
openfoodnetwork/app/controllers/api/enterprises_controller.rb

16 lines
424 B
Ruby

module Api
class EnterprisesController < Spree::Api::BaseController
respond_to :json
def managed
@enterprises = Enterprise.ransack(params[:q]).result.managed_by(current_api_user)
respond_with(@enterprises)
end
def accessible
@enterprises = Enterprise.ransack(params[:q]).result.accessible_by(current_api_user)
#respond_with(@enterprises)
render :bulk_index
end
end
end