DemocracyOS / core

1 stars 1 forks source link

Adding General Comments for documents #44

Closed guillecro closed 6 years ago

guillecro commented 6 years ago
URI Description Auth
GET /api/v1/documents/:id/comments Retrieves a list of comments of the documents. -
POST /api/v1/documents/:id/comments Creates a new comment in a document. The request body requires 2 fields: field and comment. The field is part of the fields of customForm. First, during a POST request, it validates if the field is part of the allowComments array of the customForm of the document. If not, it throws an Exception. If everything is ok, the comment is saved authenticated

Note: I might play around with mocha-steps cause I am having some issues with a POST and GET test.. Sometimes I need the POST to end properly before the GET and right now it does it job but a few times it fails.