Closed sheckathorne closed 3 weeks ago
Thanks @sheckathorne!
I know we already discussed this, I'll review this before the end of this week.
I notice that it's still sending a request with an empty epaID when the user moves focus away from the select input, which I believe it was doing before anyways(?)
We can remove that call by modifying the skip option in the useSearchRcraSitesQuery
const { data } = useSearchRcraSitesQuery(
{
siteType: handlerType,
siteId: debouncedInputValue,
},
{ skip: skip || debouncedInputValue === '' }
);
@sheckathorne, do you have the time to modify the PR to fix this? I would hate to not clear this technical debt while we're already here. If not I can make these changes.
Sorry I missed your comments, I have been traveling. I will make these edits today and also admit that I had some help with writing only the tests :)
Description
Debounces the transporter input in the manifest form while also reducing the minimum number of characters from 5 to 2 before results begin populating. Debounce will limit the number of requests made to the server when typing-to-search while the reduction in characters will allow the user to display results earlier.
Issue ticket number and link
https://github.com/USEPA/haztrak/issues/727
Checklist