Skip to content

Commit

Permalink
refactor: don't ignore empty string as a case for searching
Browse files Browse the repository at this point in the history
  • Loading branch information
mariajgrimaldi committed Apr 9, 2024
1 parent a13068d commit 9eb9bfe
Showing 1 changed file with 2 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -90,16 +90,15 @@ const CoursesFilters = ({

const handleSearchCourses = (searchValueDebounced) => {
const valueFormatted = searchValueDebounced.trim();
const searchValueRequest = valueFormatted.length > 0 ? valueFormatted : undefined;
const filterParams = {
search: searchValueRequest,
search: valueFormatted,
activeOnly,
archivedOnly,
order,
};
const hasOnlySpaces = regexOnlyWhiteSpaces.test(searchValueDebounced);

if (searchValueRequest && valueFormatted !== search && !hasOnlySpaces && !cleanFilters) {
if (valueFormatted !== search && !hasOnlySpaces && !cleanFilters) {
dispatch(updateStudioHomeCoursesCustomParams({
currentPage: 1,
isFiltered: true,
Expand Down

0 comments on commit 9eb9bfe

Please sign in to comment.