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

Cleanup: fix logic surrounding case contacts with no reimbursements #5666

Closed
elasticspoon opened this issue May 5, 2024 · 0 comments · Fixed by #5708
Closed

Cleanup: fix logic surrounding case contacts with no reimbursements #5666

elasticspoon opened this issue May 5, 2024 · 0 comments · Fixed by #5708
Labels
Help Wanted This is a special label that enables github to showcase issues that want help Type: Bug

Comments

@elasticspoon
Copy link
Collaborator

Had an issue where users could not create case contacts. This PR was a bit of a hasty fix.

Causes

The issue was when an org has neither driving reimbursement nor additional expenses no parameters would be submitted on /case_contacts/:id/form/expense.

This meant that params would not contain case_contact and params[:case_contact][:status] = step.to_s unless @case_contact.active? would fail or later with params.require(:case_contact).permit(...)

Temp Fix

The temporary fix was to add <%= form.hidden_field :placeholder, value: true %> to ensure something is always submitted.

<%= form.hidden_field :placeholder, value: true %>

This is a terrible hacky fix.

Goals

We should find a better fix on both the system and request sides. From a user perspective it probably does not make sense that page is ever shown if a user can't do anything on it. Maybe it should not be shown?

On the other hand that might add a lot of complexity and instead we should be able to gracefully recover if a request is sent with no in the params case_contact.

I am not sure what the ideal solution is but both paths are probably worth exploring.

@elasticspoon elasticspoon added Type: Bug Help Wanted This is a special label that enables github to showcase issues that want help labels May 5, 2024
@elasticspoon elasticspoon changed the title Bug: Cleanup: fix logic surrounding case contacts with no reimbursements May 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Help Wanted This is a special label that enables github to showcase issues that want help Type: Bug
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

1 participant