Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions .bass/issue.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Implement Update Todo endpoint (PATCH /todos/:id)

Implement PATCH /todos/:id to partially update a Todo. Accept optional fields `title` (string, non-empty) and `completed` (boolean). Response should be 200 OK with the updated Todo object, or 404 Not Found if the id does not exist. updatedAt should be refreshed on every successful update.

Acceptance Criteria:
- Updating only title changes title and updatedAt
- Updating only completed changes completed and updatedAt
- Updating both fields changes both and updatedAt
- Returns 404 for non-existent id
- Returns 400 if title is provided as empty string

Test Cases:
- Integration: PATCH /todos/:id { "title": "New title" } returns updated Todo with new title and updated updatedAt
- Integration: PATCH /todos/:id { "completed": true } returns updated Todo with completed=true
- Integration: PATCH /todos/:id { "title": "A", "completed": false } returns updated Todo
- Integration: PATCH /todos/:id with non-existent id returns 404
- Integration: PATCH /todos/:id { "title": "" } returns 400
- Edge: PATCH /todos/:id with {} returns 200 and Todo unchanged (or 400 depending on strictness; document behavior)

Please implement this fix.
Loading