Class: FaspClient::BackfillRequestsController
- Inherits:
-
ApplicationController
- Object
- ApplicationController
- FaspClient::BackfillRequestsController
- Defined in:
- app/controllers/fasp_client/backfill_requests_controller.rb
Instance Method Summary collapse
Methods inherited from ApplicationController
#fasp_client_controller?, #get_provider, #verify_request
Instance Method Details
#create ⇒ Object
7 8 9 10 11 12 13 14 15 16 17 18 19 |
# File 'app/controllers/fasp_client/backfill_requests_controller.rb', line 7 def create = params.deep_transform_keys(&:underscore).expect(backfill_request: [ :category, :max_count ]) req = FaspClient::BackfillRequest.create(.merge(fasp_client_provider: @provider)) if req.valid? respond_to do |format| format.json do render json: { "backfillRequest" => { "id" => req.id.to_s } }, status: :created end end else head :unprocessable_content end end |