Skip to content

Fix task bugs and add search filter - #9

Open
vedantsahai wants to merge 1 commit into
pavlinhristov:mainfrom
vedantsahai:codex/lab-fixes
Open

Fix task bugs and add search filter#9
vedantsahai wants to merge 1 commit into
pavlinhristov:mainfrom
vedantsahai:codex/lab-fixes

Conversation

@vedantsahai

@vedantsahai vedantsahai commented May 4, 2026

Copy link
Copy Markdown

Summary

  • Fix GET /tasks status filtering so the handler compares against the requested status value instead of the literal string "status".
  • Persist task completions by mutating the stored task, stamping completed_at, and saving via save_tasks, ensuring follow-up reads show the done state.
  • Add case-insensitive q search across task title and description, and make sure it composes cleanly with the status filter.

Testing

  • curl "http://127.0.0.1:8000/tasks?status=open" → returns only open tasks.
  • curl "http://127.0.0.1:8000/tasks?status=done" → returns only done tasks.
  • curl -X POST http://127.0.0.1:8000/tasks/3/complete → returns task 3 with status: done and a populated completed_at.
  • curl http://127.0.0.1:8000/tasks/3 → task 3 remains done with the same timestamp.
  • curl "http://127.0.0.1:8000/tasks?q=launch" → returns task 1.
  • curl "http://127.0.0.1:8000/tasks?status=done&q=plan" → returns task 3, demonstrating combined filters work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant