Sha256: f2f989100222a0043df658662e8d52233df4d7c9cb003884a568323138bd903a

Contents?: true

Size: 584 Bytes

Versions: 18

Compression:

Stored size: 584 Bytes

Contents

# frozen_string_literal: true

module Motor
  class ResourcesController < ApiBaseController
    wrap_parameters :data, except: %i[include fields]

    load_and_authorize_resource

    def index
      render json: { data: Motor::ApiQuery::BuildJson.call(@resources, params) }
    end

    def create
      Motor::BuildSchema::PersistResourceConfigs.call(@resource)
      Motor::Configs::WriteToFile.call

      render json: { data: Motor::ApiQuery::BuildJson.call(@resource, params) }
    end

    private

    def resource_params
      params.require(:data).permit!
    end
  end
end

Version data entries

18 entries across 18 versions & 1 rubygems

Version Path
motor-admin-0.1.57 app/controllers/motor/resources_controller.rb
motor-admin-0.1.56 app/controllers/motor/resources_controller.rb
motor-admin-0.1.55 app/controllers/motor/resources_controller.rb
motor-admin-0.1.54 app/controllers/motor/resources_controller.rb
motor-admin-0.1.53 app/controllers/motor/resources_controller.rb
motor-admin-0.1.52 app/controllers/motor/resources_controller.rb
motor-admin-0.1.51 app/controllers/motor/resources_controller.rb
motor-admin-0.1.50 app/controllers/motor/resources_controller.rb
motor-admin-0.1.49 app/controllers/motor/resources_controller.rb
motor-admin-0.1.48 app/controllers/motor/resources_controller.rb
motor-admin-0.1.47 app/controllers/motor/resources_controller.rb
motor-admin-0.1.46 app/controllers/motor/resources_controller.rb
motor-admin-0.1.44 app/controllers/motor/resources_controller.rb
motor-admin-0.1.43 app/controllers/motor/resources_controller.rb
motor-admin-0.1.42 app/controllers/motor/resources_controller.rb
motor-admin-0.1.41 app/controllers/motor/resources_controller.rb
motor-admin-0.1.40 app/controllers/motor/resources_controller.rb
motor-admin-0.1.39 app/controllers/motor/resources_controller.rb