Changeset 527 for Dev/trunk/src/server/api/surveyRuns.js
- Timestamp:
- 03/23/14 17:26:12 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
Dev/trunk/src/server/api/surveyRuns.js
r525 r527 30 30 }); 31 31 } 32 hr.handle(res.send.bind(res)); 32 hr.handle({'-1': util.handleException}) 33 .handle(res.send.bind(res)); 33 34 }); 34 35 app.get('/:id', … … 53 54 hr = util.putDocument(id,rev,'SurveyRun',doc); 54 55 } 55 hr.handle(res.send.bind(res)); 56 hr.handle({'-1': util.handleException}) 57 .handle(res.send.bind(res)); 56 58 }); 57 59 app.delete('/:id', … … 70 72 } 71 73 } 72 }).handle(res.send.bind(res)); 74 }) 75 .handle({'-1': util.handleException}) 76 .handle(res.send.bind(res)); 73 77 }); 74 78 app.get('/:id/responses', … … 77 81 var id = req.params.id; 78 82 responses.getResponsesBySurveyRunId(id) 83 .handle({'-1': util.handleException}) 79 84 .handle(res.send.bind(res)); 80 85 }); … … 85 90 responses.getResponsesBySurveyRunId(id) 86 91 .handle({ 92 '-1': function(result) { 93 util.handleException(result) 94 .handle(res.send.bind(res)); 95 }, 87 96 200: function(responses) { 88 97 var answers = _.map(responses,function(response){
Note: See TracChangeset
for help on using the changeset viewer.