Add tags API route #66

Merged
erik merged 1 commit from feat/task-8fbb8c0c-tags-api-route into main 2026-05-23 08:05:34 -05:00
Owner

Summary

Implement the authenticated tags listing API route for Slugkit.

Task

Task: #task-8fbb8c0c

Changes

  • Add GET /api/v1/tags with bearer auth and operation tags.list.
  • Add a tags query helper returning tag records with post usage counts.
  • Register tags routes in the API app.
  • Document /tags, Tag, TagSummary, and TagListResponse in OpenAPI.
  • Add API tests for auth, empty tags, post-created/post-updated tags, counts, and OpenAPI coverage.

Testing

  • Unit/API tests added/updated
  • Manual testing performed: created a tagged post against local dev API and verified GET /api/v1/tags
  • make check passes
  • ./scripts/pre-pr.sh passes

Checklist

  • ./scripts/pre-pr.sh passes
  • Documentation updated (if needed)
  • No unrelated changes included
## Summary Implement the authenticated tags listing API route for Slugkit. ## Task Task: #task-8fbb8c0c ## Changes - Add `GET /api/v1/tags` with bearer auth and operation `tags.list`. - Add a tags query helper returning tag records with post usage counts. - Register tags routes in the API app. - Document `/tags`, `Tag`, `TagSummary`, and `TagListResponse` in OpenAPI. - Add API tests for auth, empty tags, post-created/post-updated tags, counts, and OpenAPI coverage. ## Testing - [x] Unit/API tests added/updated - [x] Manual testing performed: created a tagged post against local dev API and verified `GET /api/v1/tags` - [x] `make check` passes - [x] `./scripts/pre-pr.sh` passes ## Checklist - [x] `./scripts/pre-pr.sh` passes - [x] Documentation updated (if needed) - [x] No unrelated changes included
feat: add tags API route
All checks were successful
CI / build-lint-test (pull_request) Successful in 32s
6fb5bc2210
Task: #task-8fbb8c0c
Author
Owner

PR Review: Approved

Summary

Reviewed PR #66 at commit 6fb5bc2. The PR adds authenticated GET /api/v1/tags support, a tag listing query with post usage counts, route registration, OpenAPI documentation, and API/OpenAPI tests.

Acceptance Criteria

  • Can list tags — met — registerApiTagsRoutes exposes GET /tags, returning createSuccessResponse(listTags(...)).
  • Empty tag list returns data: [] — met — tags.test.ts covers an authenticated empty database response of { data: [] }.
  • Tags created through post operations appear in tag listing — met — tests create and update posts with tagSlugs, then verify the tags API returns notes and tech.
  • Route uses shared auth/error behavior — met — route uses createBearerAuthMiddleware and the shared API key validator; tests verify unauthenticated 401 with operation tags.list.
  • Route appears in OpenAPI with the documented operation ID — met — /tags is documented with operation ID tags.list, bearer auth, response schema, and shared 401; route tests assert coverage.
  • Relevant lint/test checks pass — met — make check, ./scripts/pre-pr.sh, manual local API smoke, and Forgejo CI passed.

Blocking Issues

None.

Warnings

None.

Verdict

Approved for merge after explicit human approval.

## PR Review: Approved ### Summary Reviewed PR #66 at commit `6fb5bc2`. The PR adds authenticated `GET /api/v1/tags` support, a tag listing query with post usage counts, route registration, OpenAPI documentation, and API/OpenAPI tests. ### Acceptance Criteria - [x] Can list tags — met — `registerApiTagsRoutes` exposes `GET /tags`, returning `createSuccessResponse(listTags(...))`. - [x] Empty tag list returns `data: []` — met — `tags.test.ts` covers an authenticated empty database response of `{ data: [] }`. - [x] Tags created through post operations appear in tag listing — met — tests create and update posts with `tagSlugs`, then verify the tags API returns `notes` and `tech`. - [x] Route uses shared auth/error behavior — met — route uses `createBearerAuthMiddleware` and the shared API key validator; tests verify unauthenticated `401` with operation `tags.list`. - [x] Route appears in OpenAPI with the documented operation ID — met — `/tags` is documented with operation ID `tags.list`, bearer auth, response schema, and shared `401`; route tests assert coverage. - [x] Relevant lint/test checks pass — met — `make check`, `./scripts/pre-pr.sh`, manual local API smoke, and Forgejo CI passed. ### Blocking Issues None. ### Warnings None. ### Verdict Approved for merge after explicit human approval.
erik merged commit 89ffafea06 into main 2026-05-23 08:05:34 -05:00
erik deleted branch feat/task-8fbb8c0c-tags-api-route 2026-05-23 08:05:34 -05:00
Sign in to join this conversation.
No description provided.