Class: V0::InProgressFormsController
- Inherits:
-
ApplicationController
- Object
- ActionController::API
- ApplicationController
- V0::InProgressFormsController
- Includes:
- IgnoreNotFound
- Defined in:
- app/controllers/v0/in_progress_forms_controller.rb
Direct Known Subclasses
Constant Summary
Constants inherited from ApplicationController
ApplicationController::VERSION_STATUS
Constants included from SignIn::Authentication
SignIn::Authentication::BEARER_PATTERN
Constants included from ExceptionHandling
ExceptionHandling::SKIP_SENTRY_EXCEPTION_TYPES
Instance Method Summary collapse
Methods included from IgnoreNotFound
Methods inherited from ApplicationController
#clear_saved_form, #cors_preflight, #routing_error
Methods included from Traceable
Methods included from SentryLogging
#log_exception_to_sentry, #log_message_to_sentry, #non_nil_hash?, #normalize_level, #rails_logger
Methods included from SignIn::Authentication
#authenticate, #authenticate_service_account, #load_user
Methods included from Headers
#block_unknown_hosts, #set_app_info_headers
Methods included from AuthenticationAndSSOConcerns
#authenticate, #clear_session, #extend_session!, #load_user, #log_sso_info, #render_unauthorized, #reset_session, #set_api_cookie!, #set_session_expiration_header, #sso_logging_info, #validate_inbound_login_params, #validate_session
Instance Method Details
#destroy ⇒ Object
30 31 32 33 34 35 |
# File 'app/controllers/v0/in_progress_forms_controller.rb', line 30 def destroy raise Common::Exceptions::RecordNotFound, form_id if form_for_user.blank? form_for_user.destroy render json: form_for_user, key_transform: :unaltered end |
#index ⇒ Object
8 9 10 11 12 |
# File 'app/controllers/v0/in_progress_forms_controller.rb', line 8 def index # :unaltered prevents the keys from being deeply transformed, which might corrupt some keys # see https://github.com/department-of-veterans-affairs/va.gov-team/issues/17595 for more details render json: InProgressForm.for_user(@current_user), key_transform: :unaltered end |
#show ⇒ Object
14 15 16 |
# File 'app/controllers/v0/in_progress_forms_controller.rb', line 14 def show render json: form_for_user&. || camelized_prefill_for_user end |
#update ⇒ Object
18 19 20 21 22 23 24 25 26 27 28 |
# File 'app/controllers/v0/in_progress_forms_controller.rb', line 18 def update form = InProgressForm.form_for_user(form_id, @current_user) || InProgressForm.new(form_id:, user_uuid: @current_user.uuid) form.user_account = @current_user.user_account form.real_user_uuid = @current_user.uuid ClaimFastTracking::MaxCfiMetrics.log_form_update(form, params) form.update!(form_data: params[:form_data] || params[:formData], metadata: params[:metadata]) render json: form, key_transform: :unaltered end |