Description:
Currently, the TicketPage doesn't properly handle the case when the id provided does not exist in the system. If the ID doesn't correspond to an existing ticket, the page crashes unexpectedly.
Expected Behavior:
- If the
id does not correspond to any ticket, the user should see a clear error message like "Ticket not found" or be redirected to a custom 404 page.
- The
getTicketById function should handle invalid cases gracefully by returning a null or some indication when the ticket is not found, avoiding any crashes or undefined states.
Steps to Reproduce:
- Attempt to access
TicketPage with an invalid ticket ID (for eg. try hitting http://localhost:3000/TicketPage/invalid-ticket-id).
- Observe that the app breaks.
We need to make sure the getTicketById function correctly handles failure scenarios, including cases where the API does not return a valid ticket, and shows appropriate feedback on the page.
Description:
Currently, the
TicketPagedoesn't properly handle the case when theidprovided does not exist in the system. If the ID doesn't correspond to an existing ticket, the page crashes unexpectedly.Expected Behavior:
iddoes not correspond to any ticket, the user should see a clear error message like "Ticket not found" or be redirected to a custom 404 page.getTicketByIdfunction should handle invalid cases gracefully by returning anullor some indication when the ticket is not found, avoiding any crashes or undefined states.Steps to Reproduce:
TicketPagewith an invalid ticket ID (for eg. try hittinghttp://localhost:3000/TicketPage/invalid-ticket-id).We need to make sure the
getTicketByIdfunction correctly handles failure scenarios, including cases where the API does not return a valid ticket, and shows appropriate feedback on the page.