Replace pending comments route with filters #80

Closed
opened 2026-06-01 12:03:07 -05:00 by caradoc · 2 comments
Collaborator

Goal

Replace the special-purpose pending comments endpoint with a general comments listing endpoint that supports moderation and search filters.

Requirements

  • Add GET /api/v1/comments as the global comments list endpoint.
  • Support combinable query filters:
    • status=pending|approved|hidden|all
    • postSlug=<slug>
    • author=<search> matching author name, handle, or profile URL
    • receivedFrom=<date-or-datetime>
    • receivedTo=<date-or-datetime>
  • Default status behavior should be explicit in the spec and implementation.
  • Remove GET /api/v1/comments/pending from routing and OpenAPI.
  • Update docs/specs to prefer GET /api/v1/comments?status=pending for moderation queues.
  • Keep GET /api/v1/posts/{slug}/comments for post-scoped comment listing.
  • Use shared auth, validation, not-found, and not-implemented error behavior.
  • Add tests for status filtering, post slug filtering, author search, date range filtering, combined filters, auth, removed pending route, and OpenAPI coverage.

Acceptance criteria

  • GET /api/v1/comments?status=pending lists pending comments across posts.
  • GET /api/v1/comments?postSlug=<slug> filters comments by post.
  • GET /api/v1/comments?author=<search> filters by author name, handle, or profile URL.
  • receivedFrom and receivedTo filter comments by received timestamp.
  • Filters can be combined.
  • GET /api/v1/comments/pending is no longer routed or documented.
  • GET /api/v1/posts/{slug}/comments still works for post-scoped comment listing.
  • OpenAPI documents the new global comments route and query parameters.
  • Relevant tests and checks pass.

Dependencies

  • None
## Goal Replace the special-purpose pending comments endpoint with a general comments listing endpoint that supports moderation and search filters. ## Requirements - Add `GET /api/v1/comments` as the global comments list endpoint. - Support combinable query filters: - `status=pending|approved|hidden|all` - `postSlug=<slug>` - `author=<search>` matching author name, handle, or profile URL - `receivedFrom=<date-or-datetime>` - `receivedTo=<date-or-datetime>` - Default `status` behavior should be explicit in the spec and implementation. - Remove `GET /api/v1/comments/pending` from routing and OpenAPI. - Update docs/specs to prefer `GET /api/v1/comments?status=pending` for moderation queues. - Keep `GET /api/v1/posts/{slug}/comments` for post-scoped comment listing. - Use shared auth, validation, not-found, and not-implemented error behavior. - Add tests for status filtering, post slug filtering, author search, date range filtering, combined filters, auth, removed pending route, and OpenAPI coverage. ## Acceptance criteria - [ ] `GET /api/v1/comments?status=pending` lists pending comments across posts. - [ ] `GET /api/v1/comments?postSlug=<slug>` filters comments by post. - [ ] `GET /api/v1/comments?author=<search>` filters by author name, handle, or profile URL. - [ ] `receivedFrom` and `receivedTo` filter comments by received timestamp. - [ ] Filters can be combined. - [ ] `GET /api/v1/comments/pending` is no longer routed or documented. - [ ] `GET /api/v1/posts/{slug}/comments` still works for post-scoped comment listing. - [ ] OpenAPI documents the new global comments route and query parameters. - [ ] Relevant tests and checks pass. ## Dependencies - None
Owner

Synced from todu comment by @todu on 2026-06-02T16:14:13.422Z

PR review

PR #85 reviewed and approved.

Acceptance criteria: 9 total, 9 met, 0 missing.

Blocking issues: 0.

Warnings: 0.

Verification reviewed: targeted comments/OpenAPI tests passed, npm test passed, npm run lint passed, npm run typecheck passed, ./scripts/pre-pr.sh passed, and Forgejo CI is success for commit 8688964a15a91e090ed86896e27e1ff223b35534.

Verdict: approved; waiting for explicit human merge approval.

_Synced from todu comment by @todu on 2026-06-02T16:14:13.422Z_ ## PR review PR #85 reviewed and approved. Acceptance criteria: 9 total, 9 met, 0 missing. Blocking issues: 0. Warnings: 0. Verification reviewed: targeted comments/OpenAPI tests passed, `npm test` passed, `npm run lint` passed, `npm run typecheck` passed, `./scripts/pre-pr.sh` passed, and Forgejo CI is `success` for commit `8688964a15a91e090ed86896e27e1ff223b35534`. Verdict: approved; waiting for explicit human merge approval.
erik 2026-06-02 12:17:19 -05:00
Owner

Synced from todu comment by @todu on 2026-06-02T17:13:42.040Z

Completed

  • PR #85 (feat: add filtered comments list route) is merged into main; local main is clean and aligned with origin/main at merge commit 1668b1e.
  • Acceptance criteria were re-checked against the merged repository state:
    • GET /api/v1/comments?status=pending is routed by comments.list, filters by moderation status, and is covered by the pending-across-posts test.
    • postSlug, author, receivedFrom, and receivedTo are validated and passed into listComments; listComments combines filters with AND clauses and tests cover each filter plus combined filters.
    • GET /api/v1/comments/pending is absent from OpenAPI/routing and has a 404 test.
    • GET /api/v1/posts/{slug}/comments remains routed and tested for post-scoped listing.
    • OpenAPI and docs/specs document GET /comments with status, postSlug, author, receivedFrom, and receivedTo, and docs prefer GET /comments?status=pending for moderation queues.
  • Existing reviewed verification for PR #85 reported targeted comments/OpenAPI tests, npm test, npm run lint, npm run typecheck, ./scripts/pre-pr.sh, and Forgejo CI all passing; no stack-specific verification commands were rerun for close gate.
_Synced from todu comment by @todu on 2026-06-02T17:13:42.040Z_ ### Completed - PR #85 (`feat: add filtered comments list route`) is merged into `main`; local `main` is clean and aligned with `origin/main` at merge commit `1668b1e`. - Acceptance criteria were re-checked against the merged repository state: - `GET /api/v1/comments?status=pending` is routed by `comments.list`, filters by moderation status, and is covered by the pending-across-posts test. - `postSlug`, `author`, `receivedFrom`, and `receivedTo` are validated and passed into `listComments`; `listComments` combines filters with `AND` clauses and tests cover each filter plus combined filters. - `GET /api/v1/comments/pending` is absent from OpenAPI/routing and has a 404 test. - `GET /api/v1/posts/{slug}/comments` remains routed and tested for post-scoped listing. - OpenAPI and docs/specs document `GET /comments` with `status`, `postSlug`, `author`, `receivedFrom`, and `receivedTo`, and docs prefer `GET /comments?status=pending` for moderation queues. - Existing reviewed verification for PR #85 reported targeted comments/OpenAPI tests, `npm test`, `npm run lint`, `npm run typecheck`, `./scripts/pre-pr.sh`, and Forgejo CI all passing; no stack-specific verification commands were rerun for close gate.
Sign in to join this conversation.
No milestone
No project
No assignees
2 participants
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
erik/slugkit#80
No description provided.