Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

80453 pt2 rehydrate 5655 controller #16459

Merged
merged 5 commits into from
Apr 24, 2024

Conversation

kjsuarez
Copy link
Contributor

Summary

We're exposing api endpoints to allow the frontend to rehydrate a form for a previously submitted FSR.

Related issue(s)

Testing done

Specs added.

What areas of the site does it impact?

Will eventually impact the FSR and debt portal. Currently these endpoints are used by nobody.

Acceptance criteria

Rehydrate endpoint only allows a user to rehydrate InProgressForm for their submissions.

def rehydrate
submission_id = params[:submission_id]

DebtsApi::V0::FsrRehydrationService.attempt_rehydration(user_uuid: current_user.uuid, submission_id:)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is submission_id: missing a value?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nope! Ruby has a fun little bit of syntactic sugar where you don't need to specify a value for hash key-value pairs if the key and value are the same. In this case line 33 defines submission_id in scope so we don't need to specify submission_id: submission_id. If you want to make doubly sure that it works, check out modules/debts_api/spec/request/debts_api/v0/financial_status_reports_controller_spec.rb

Copy link
Contributor

@amponce amponce left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me!

@kjsuarez kjsuarez merged commit 709e36e into master Apr 24, 2024
23 checks passed
@kjsuarez kjsuarez deleted the 80453-pt2-rehydrate-5655-controller branch April 24, 2024 13:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants