Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Follow+Notes: Expose grant notes creation in Finder API #3204

Open
Tracked by #2960
TylerHendrickson opened this issue Jun 21, 2024 · 0 comments
Open
Tracked by #2960

Follow+Notes: Expose grant notes creation in Finder API #3204

TylerHendrickson opened this issue Jun 21, 2024 · 0 comments
Assignees
Labels
collaboration Grant Finder Issues related to the Grant Finder javascript Pull requests that update Javascript code

Comments

@TylerHendrickson
Copy link
Member

TylerHendrickson commented Jun 21, 2024

Subtask of [STORY]: Update 'Status' to 'Follow + Note' feature #2960

Blocked by

Blocks

Definition of Done

A new API route exists that allows users to publish (and revise) notes pertaining to a specific grant.

Implementation Details

In packages/server/src/routes/grants.js, define a new PUT /:grantId/notes/revision API route handler as follows:

  • Requires authentication.
  • Requires that the organization (tenant) of the authenticated user matches the :organizationId request path parameter.
  • Calls saveNoteRevision() from packages/server/src/lib/grantsCollaboration to persist a new note and/or note revision to the database.
  • Subsequently calls followGrant() from packages/server/src/lib/grantsCollaboration so that the user who posted the comment is automatically marked as following the grant. This should only happen if the call to saveNoteRevision() was successful (did not throw any error).
  • Begins a new database transaction on the knex object that is passed to saveNoteRevision() and followGrant() (so that both function calls are encapsulated in the same database transaction) and commits the transaction after both function calls have returned without throwing any error. If either function throws an error, the transaction should be rolled back and an error response issued.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
collaboration Grant Finder Issues related to the Grant Finder javascript Pull requests that update Javascript code
Projects
Status: 🚢 Completed
Development

No branches or pull requests

3 participants