18F/identity-dashboard

View on GitHub
app/controllers/api/security_events_controller.rb

Summary

Maintainability
A
0 mins
Test Coverage
A
100%
module Api
  class SecurityEventsController < ApplicationController
    skip_forgery_protection

    def create
      form = SecurityEventForm.new(body: request.body.read)
      success, errors = form.submit

      if success
        head :created
      else
        Rails.logger.warn(errors.to_hash)

        head :bad_request
      end
    end
  end
end