Skip to content

Fix task bugs and add search filter - #42

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

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

Conversation

@AntonKruhlou

Copy link
Copy Markdown

Summary

Completes the CodexLab Task Tracker lab: fixes both intentional bugs and adds the search feature.

  • Fix Bug A: GET /tasks?status=... compared against the literal string "status" instead of the query parameter, so any status filter returned an empty list. Now compares against the actual status value.
  • Fix Bug B: POST /tasks/{id}/complete built the updated task but never wrote it back to the in-memory list or called save_tasks, so completion never persisted. Now updates the list in place and saves it.
  • Add feature: q query parameter on GET /tasks does a case-insensitive substring search across title and description, composable with status, and is a no-op when omitted.

Verification

  • curl "/tasks?status=open" / ?status=done each return only matching tasks
  • POST /tasks/3/complete then GET /tasks/3 shows status: done with a non-null completed_at
  • q=launch, q=report, q=LAUNCH (case-insensitive) all match expected tasks
  • status=open&q=launch combines both filters correctly
  • data/tasks.json restored to its original committed state before this PR (no runtime test data included)

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