aboutsummaryrefslogtreecommitdiff
path: root/routes/index.js
diff options
context:
space:
mode:
authorkdam0 <kumar.damani@mail.utoronto.ca>2017-02-02 01:55:12 +0000
committerkdam0 <kumar.damani@mail.utoronto.ca>2017-02-02 01:55:12 +0000
commite78238959da75e4574bb4bbd4dc1c4433d02785b (patch)
treeb62a9302cf1e450953d1fddc64b368727b61086b /routes/index.js
parent98c9cbc6258f699fc944f025230c35faf8575bc2 (diff)
better error handling and clean up
Diffstat (limited to 'routes/index.js')
-rw-r--r--routes/index.js7
1 files changed, 5 insertions, 2 deletions
diff --git a/routes/index.js b/routes/index.js
index 31f5442..04ee1ff 100644
--- a/routes/index.js
+++ b/routes/index.js
@@ -21,8 +21,11 @@ router.get('/', function(req, res, next) {
router.get('/auto-complete-courses', function(req, res, next) {
// console.log('in controller');
- dbFile.find_all_course_codes_from_exams( function (data) {
- res.send(JSON.stringify(data));
+ dbFile.find_all_course_codes_from_exams( function (success, data) {
+ var res_obj = {};
+ res_obj.success = success;
+ res_obj.data = data;
+ res.send(JSON.stringify(res_obj));
});
});