Update Redirect Behavior Based on Success of Pet Creation #1342
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
🔗 Issue
references #1335
✍️ Description
Currently, when a staff creates a pet, the redirect behavior is as follows:
Successful Creation -> Redirect to Index
Unsuccessful Creation -> Redirect to New
However, this is not the behavior that we want. Instead, the redirect behavior should be as follows:
Successful Creation -> Redirect to Show for Newly Created Pet
Unsuccessful Creation -> Redirect to Index and Flash Error
I did not add controller tests for this change as advised in the ticket, but I am happy to do so if it would be beneficial!
📷 Screenshots/Demos
https://cassie.neetorecord.com/watch/072465a0442f283a16d7