-
Notifications
You must be signed in to change notification settings - Fork 0
Route using a Model
Karen Coombs edited this page Jul 10, 2018
·
1 revision
In order to display the actual ILL Request data we have to retrieve it from the API and pass it to our view.
- Open server.js
- Find HTTP POST request route
app.get('/request', (req, res) => {
- Remove line
res.render('display-request');
- Use the ILLRequest class to create an ILLRequest and display the associated information
ILLRequest.add(config['institution'], app.get('accessToken').getAccessTokenString(), fields)
.then(ill_request => {
res.render('display-request', {request: ill_request});
})
.catch (error => {
// catch the error
})