[APP-707] feat: add save report modal#3364
Conversation
ba2513e to
44c28e5
Compare
brick-green
left a comment
There was a problem hiding this comment.
Couple little things
| .catch((err) => { | ||
| setError(JSON.stringify(err)); | ||
| }); |
There was a problem hiding this comment.
q, maybe b: what does the shape of this err look like? Is there a message or body or something to be used?
There was a problem hiding this comment.
I don't know if it ever made it's way into the UI given it's handled API-side through exception handlers, but 4xx/5xx errors from all reports endpoints use the ErrorResponseBody interface for their response bodies, which look like:
{
message: String;
}
If we want to use that here!
There was a problem hiding this comment.
OOO Thank you!! I'll update!
| ); | ||
|
|
||
| const redirectToManageReport = () => { | ||
| window.location.href = '/nbs/nfc?ObjectType=7&OperationType=116'; |
There was a problem hiding this comment.
Gemini recommended something like this:
| window.location.href = '/nbs/nfc?ObjectType=7&OperationType=116'; | |
| const navigate = useNavigate(); | |
| navigate('/nbs/nfc?ObjectType=7&OperationType=116'); |
as I understand it window.location.href forces a full page reload which perhaps isn't always necessary. A little out of my depths here though. Thoughts?
There was a problem hiding this comment.
+1 here, I think we lose all application state on a forced page reload like this - would def prefer navigation through the React router if we're able!
There was a problem hiding this comment.
I don't think we are able to since that part of the app hasn't been modernized 😢 Which is why I believe we are doing this similarly here
Description
Recording
savereport.page.mov
Tickets
Checklist before requesting a review