Skip to content

Add search functionality to case listings #7

Description

@darshacharya

Description

Users cannot search for cases by keyword. The browse page has category and urgency filters but no text search.

Requirements

Backend

  • Add a search query parameter to GET /api/cases
  • Search should match against case title and description (case-insensitive)
  • Also add to GET /api/admin/cases

Frontend

  • Add a search input at the top of the cases browse page (frontend/src/app/cases/page.tsx)
  • Debounce the search input (300ms) to avoid excessive API calls
  • Add search to the admin dashboard list (frontend/src/app/admin/page.tsx)
  • Show "No results for 'query'" when search returns empty

Tech Notes

  • Backend: Use SQLAlchemy's ilike for case-insensitive search
  • Frontend: Use useEffect with a debounce timer or a useDebouncedValue hook

Acceptance Criteria

  • Users can search cases by title/description
  • Search is debounced on the frontend
  • Empty search results show a helpful message
  • Admin can also search cases
  • Search works in combination with existing filters

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions