Follow+Notes: Expose grant notes creation in Finder API #3204
Labels
collaboration
Grant Finder
Issues related to the Grant Finder
javascript
Pull requests that update Javascript code
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 newPUT /:grantId/notes/revision
API route handler as follows::organizationId
request path parameter.saveNoteRevision()
frompackages/server/src/lib/grantsCollaboration
to persist a new note and/or note revision to the database.followGrant()
frompackages/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 tosaveNoteRevision()
was successful (did not throw any error).knex
object that is passed tosaveNoteRevision()
andfollowGrant()
(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.The text was updated successfully, but these errors were encountered: