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

Enable routing from eligibility form to case screen #40

Merged
merged 2 commits into from
Nov 17, 2023

Conversation

surajr10
Copy link
Contributor

What's new in this PR

Added functionality to enable routing from eligibility form back to case screen and have it be updated.

Description

After updating the eligibility by pressing one of the eligibility option buttons, we re-fetch the case from Supabase, and pass that as a route parameter to the Case screen in order for it to properly render the new update.

Screenshots

How to review

Click into a CaseCard to go into the Case screen, and navigate to the Eligibility form. Try opting in, and then you should be taken back to the Case screen, but have the info presented be updated to show you the proper changes.

Next steps

This is a version 1 solution. I think ideally what we would want is to create dynamic routing for the CaseScreen where it can take the caseId as the parameter. Then we probably want to lift the state of status up so that both the CaseScreen and EligibilityForm (and anything else that may use it) can call setStatus as that is essentially the only front-end thing that needs to be changed. Not exactly sure how this can be done simply because it seems that we can't pass setState functions through router.push without errors as of right now.

I would say that we shouldn't need to refetch the case or case status when navigating between CaseScreen, Eligibility Form, and Case Summary. The case data should just remain constant I believe, and the status should be updated through a useState variable. Additionally, we should set up dynamic routing for the CaseScreen.

Relevant Links

Online sources

Related PRs

CC: @stephaniewong2

@surajr10 surajr10 merged commit 8bbcea5 into main Nov 17, 2023
2 checks passed
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.

1 participant