refactor: tighten task API route adapters #379

Merged
barrettruth merged 1 commit from issue-364-task-api-route-adapters into main 2026-05-11 21:25:29 +00:00
Owner

Problem

Task API routes duplicated request auth, path ID conversion, owned-task lookup, mutation error mapping, and dependency body handling around the task mutation service.

Solution

  • Add a task route adapter helper for shared auth, task ID parsing, owned-task lookup, validation/not-found/error responses, and TaskMutationError mapping.
  • Refactor task item, complete, dependency, and top-level task routes through the helper while leaving list filter parsing behavior unchanged for #361.
  • Preserve existing status codes and JSON response shapes.

Verification

  • nix develop --command pnpm vitest run tests/api/tasks-route-validation.test.ts tests/api/deps.test.ts tests/server/task-mutations.test.ts
  • nix develop --command just ci

Closes #364

## Problem Task API routes duplicated request auth, path ID conversion, owned-task lookup, mutation error mapping, and dependency body handling around the task mutation service. ## Solution - Add a task route adapter helper for shared auth, task ID parsing, owned-task lookup, validation/not-found/error responses, and TaskMutationError mapping. - Refactor task item, complete, dependency, and top-level task routes through the helper while leaving list filter parsing behavior unchanged for #361. - Preserve existing status codes and JSON response shapes. ## Verification - nix develop --command pnpm vitest run tests/api/tasks-route-validation.test.ts tests/api/deps.test.ts tests/server/task-mutations.test.ts - nix develop --command just ci Closes #364
refactor: tighten task API route adapters
All checks were successful
quality / Test (pull_request) Successful in 16s
quality / Lint (pull_request) Successful in 20s
quality / Build (pull_request) Successful in 42s
57126e7d77
barrettruth deleted branch issue-364-task-api-route-adapters 2026-05-11 21:25:29 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
barrettruth/delta!379
No description provided.