Skip to content

Commit

Permalink
fix: fetchSearchResultsWithoutNumber trigger
Browse files Browse the repository at this point in the history
fetchSearchResultsWithoutNumber previously relied on previousSearch
value to perform the second search. However, previousSearch can take
many forms depending on the search that was done, for example it might
just be a number when searching for a specific service_id. This would
cause the second search to happen possibly search?q={service_id} instead
of unit?service_id={service_id}.

refs: PL-32
  • Loading branch information
voneiden committed Jan 8, 2025
1 parent a20a3d1 commit c7b4b76
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/views/SearchView/SearchView.js
Original file line number Diff line number Diff line change
Expand Up @@ -335,7 +335,8 @@ function SearchView() {
}
} else {
const { previousSearch, isFetching } = searchFetchState;
if (previousSearch && !isFetching) {
const options = getSearchParamData();
if (options.q && previousSearch && !isFetching) {
// If no results found, try to fetch results without number
fetchSearchResultsWithoutNumber(previousSearch);
}
Expand Down

0 comments on commit c7b4b76

Please sign in to comment.