Skip to content

fix: public comment by id 500, comment staff fields, small API fixes - #949

Merged
danieltruong merged 3 commits into
developfrom
fix-todo-small
Oct 14, 2026
Merged

danieltruong merged 3 commits into
developfrom
fix-todo-small

Conversation

@danieltruong

@danieltruong danieltruong commented Oct 14, 2026 •

Copy link
Copy Markdown
Collaborator

Three commits.

  1. GET /api/public/comment/:id returned 500. The by-id route has no count parameter, and the handler read count.value. The route now returns an array: the one comment, or [] when no public comment has that id. The author is hidden unless isAnonymous is false, here and in the comment search. Public routes no longer accept staff review fields in fields (new PublicCommentFields enum in swagger).

  2. Small fixes from the repo TODO list:

    • Search passes the signed-in flag into createMatchAggr instead of working it out again from roles.
    • Publish on a locked project returns 409 for a non-numeric year, same as PUT.
    • Remove unused projectDAO.publishProject, which set the Act with no lock or content check.
    • Swagger notes that a locked project gets 409 before 404, and the publish 404 gets the Error schema.
    • The deploy-to-prod comment no longer claims it checks that the version ran on test.
    • New test for a PUT that moves a project to 2025.
  3. Public item search on a comment (/public/search?dataset=Item&_schemaName=Comment) returned the staff fields eaoNotes, eaoStatus, proponentNotes, rejectedNotes and rejectedReason. They are now dropped for callers who are not signed in, using one shared list with the public comment routes. Also adds a test that search passes the signed-in flag to the document match.

The by-id route declares no count parameter, so reading count.value
threw. Return an array, empty when no public comment matches. Hide
the author unless isAnonymous is false, and keep staff review fields
off the public routes.
- Pass the signed-in flag from search into createMatchAggr instead
  of working it out again from roles.
- Publish on a locked project returns 409 for a non-numeric year,
  same as PUT.
- Remove unused projectDAO.publishProject, which set the Act with no
  lock or content check.
- Swagger: note that a locked project gets 409 before 404, and add
  the Error schema to the publish 404.
- Correct the deploy-to-prod comment: it does not check that the
  version ran on test.
- Test a PUT that moves a project to 2025.
Public item search on a comment returned eaoNotes, eaoStatus,
proponentNotes, rejectedNotes and rejectedReason, because the item
pipeline has no field projection. Drop them for callers who are not
signed in, using one shared list with the public comment routes.

Also test that search passes the signed-in flag to the document
match.
@danieltruong danieltruong changed the title fix: public comment by id 500, and small API fixes fix: public comment by id 500, comment staff fields, small API fixes Oct 14, 2026
@danieltruong
danieltruong merged commit 994bd77 into develop Oct 14, 2026
4 checks passed
@danieltruong
danieltruong deleted the fix-todo-small branch October 14, 2026 00:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant