Skip to content

Implement List Todos endpoint (GET /todos) with status filter #5

@landoyjx

Description

@landoyjx

Implement GET /todos to return all Todo items. Support optional query parameter completed=true|false to filter results. Response should be 200 OK with an array of Todo objects.

Acceptance Criteria:

  • Returns 200 with an array of all todos when no filter is provided
  • Returns 200 with only completed todos when ?completed=true
  • Returns 200 with only incomplete todos when ?completed=false
  • Empty array is returned when no matching todos exist

Test Cases:

  • Integration: GET /todos returns all todos in descending createdAt order (or consistent order)
  • Integration: GET /todos?completed=true returns only todos where completed is true
  • Integration: GET /todos?completed=false returns only todos where completed is false
  • Edge: GET /todos?completed=invalid returns 400 with JSON error
  • Edge: GET /todos when no todos exist returns 200 and []

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions