Skip to content

Add sorting options to case browse page #9

Description

@darshacharya

Description

The case browse page only sorts by creation date (newest first). Users should be able to sort by different criteria.

Requirements

Backend

  • Add a `sort` query parameter to `GET /api/cases`
  • Supported values: `newest`, `oldest`, `most_funded`, `least_funded`, `urgency`

Frontend

  • Add a sort dropdown next to the existing filters on `frontend/src/app/cases/page.tsx`
  • Options: "Newest", "Oldest", "Most Funded", "Least Funded", "Urgency"

Tech Notes

  • Backend: `backend/app/routers/cases.py` — add `order_by` logic based on the `sort` param
  • For urgency sorting, map to: critical > high > medium > low

Acceptance Criteria

  • Sort dropdown appears on browse page
  • All 5 sort options work correctly
  • Sort works in combination with category/urgency filters
  • Default sort is "Newest"

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions