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

Fix "Create Case" Error #708

Merged
merged 1 commit into from
Jan 9, 2025
Merged

Fix "Create Case" Error #708

merged 1 commit into from
Jan 9, 2025

Conversation

coreyogburn
Copy link
Contributor

When creating a case, we 1) make a call to create a case, 2) $router.replace to update the url with the new case ID, 3) use the route params to load the case. Step 2 is async so step 3 used the old ID param of create. Adding an await on step 2 ensures that the new route params are used in step 3 and we don't attempt to retrieve a case with a bad ID.

In Vue 2, $router.replace was effectively synchronous as it updated the $route without the need of await.

When creating a case, we 1) make a call to create a case, 2) $router.replace to update the url with the new case ID, 3) use the route params to load the case. Step 2 is async so step 3 used the old ID param of `create`. Adding an await on step 2 ensures that the new route params are used in step 3 and we don't attempt to retrieve a case with a bad ID.
@coreyogburn coreyogburn merged commit be54c5f into 2.4/dev Jan 9, 2025
3 checks passed
@coreyogburn coreyogburn deleted the cogburn/create-case-error branch January 9, 2025 16:59
@github-actions github-actions bot locked and limited conversation to collaborators Jan 9, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants