iZooGooD/stay-booker-hotel-booking-react-frontend

bug: The 'Clear' button triggers a data refetch even though no filters are selected.

Closed this issue · 3 comments

Describe the bug

  • On the /hotels route, clicking the 'Clear Filters' button triggers an API call even when no filters are applied.

To Reproduce
Steps to reproduce the behavior:

  1. Go to /hotels route
  2. Dont apply any filters and click on 'clear' button from left (Vertical filters sections)
  3. It causes data re-fetch

Expected behavior

  • Should not trigger refetch when there are no active filters.

Screenshots
Screenshot 2024-01-30 211122

Additional context

  • The issue needs to be addressed in the onClearFiltersAction function located in src\routes\listings\HotelsSearch.jsx

Hey, I'd like to work on this issue. I will start working on this right away.

@iZooGooD I have linked a PR.

@iZooGooD I have linked a PR.

Thanks @ketansahugit, merged.