Add tags field to todos and ?tag= filter on GET /todos #14

Open
opened 2026-05-12 07:24:51 +00:00 by danny8632 · 1 comment
Owner

Parent: #13

Goal

Base off the latest agent branch (PR #12, branch agent/issue-9-add-version-endpoint-returning-version-name). Add a tags string array field to the in-memory todo model. Update POST /todos to accept an optional tags array in the request body (default to empty array if omitted). Update GET /todos to accept an optional ?tag= query parameter and, when provided, return only todos whose tags array includes that string (case-sensitive exact match).

Done criteria

  • POST /todos with body {"title":"t","tags":["work"]} returns 201 and the response body contains tags:["work"]
  • POST /todos with body {"title":"t"} (no tags field) returns 201 and the response body contains tags:[]
  • GET /todos with no query params returns 200 and every todo object in the array has a tags field that is an array
  • GET /todos?tag=work returns 200 and all returned todos contain "work" in their tags array
  • GET /todos?tag=nonexistent returns 200 and an empty array []

Hints

Find the server entry point via package.json on the latest agent branch. The in-memory store is likely an array; update its structure and any seed data to include tags:[].

Model

sonnet

Parent: #13 ## Goal Base off the latest agent branch (PR #12, branch agent/issue-9-add-version-endpoint-returning-version-name). Add a `tags` string array field to the in-memory todo model. Update POST /todos to accept an optional `tags` array in the request body (default to empty array if omitted). Update GET /todos to accept an optional `?tag=` query parameter and, when provided, return only todos whose tags array includes that string (case-sensitive exact match). ## Done criteria - [ ] POST /todos with body {"title":"t","tags":["work"]} returns 201 and the response body contains tags:["work"] - [ ] POST /todos with body {"title":"t"} (no tags field) returns 201 and the response body contains tags:[] - [ ] GET /todos with no query params returns 200 and every todo object in the array has a tags field that is an array - [ ] GET /todos?tag=work returns 200 and all returned todos contain "work" in their tags array - [ ] GET /todos?tag=nonexistent returns 200 and an empty array [] ## Hints Find the server entry point via package.json on the latest agent branch. The in-memory store is likely an array; update its structure and any seed data to include tags:[]. ## Model sonnet
danny8632 added the agent:assign label 2026-05-12 07:24:51 +00:00
Author
Owner

agent dev-01: PR opened → #16

agent dev-01: PR opened → https://gitea.dannyhaslund.dk/danny8632/todo-app/pulls/16
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: danny8632/todo-app#14