Added Notes feature (#8)

Also:
- Moved buttons to top of request
- Tweaked layout of full request view
- Added code to ensure that users may only add history and notes to
their own requests; security FTW!
This commit is contained in:
Daniel J. Summers
2017-10-09 21:39:40 -05:00
parent b6d72d691b
commit 69811cbf54
10 changed files with 275 additions and 48 deletions
+14 -1
View File
@@ -25,6 +25,13 @@ export default {
*/
journal: () => http.get('journal/'),
/**
* Add a note for a prayer request
* @param {string} requestId The Id of the request to which the note applies
* @param {string} notes The notes to be added
*/
addNote: (requestId, notes) => http.post(`request/${requestId}/note`, { notes }),
/**
* Add a new prayer request
* @param {string} requestText The text of the request to be added
@@ -55,6 +62,12 @@ export default {
/**
* Get all answered requests, along with the text they had when it was answered
*/
getAnsweredRequests: () => http.get('request/answered')
getAnsweredRequests: () => http.get('request/answered'),
/**
* Get past notes for a prayer request
* @param {string} requestId The Id of the request for which notes should be retrieved
*/
getNotes: requestId => http.get(`request/${requestId}/notes`)
}