Преглед изворни кода

Return meaningful response

jmacura пре 5 година
родитељ
комит
07ee2a05fb
1 измењених фајлова са 2 додато и 4 уклоњено
  1. 2 4
      index.js

+ 2 - 4
index.js

@@ -132,10 +132,8 @@ app.get('/runR', (req, res, next) => {
         function(err, data) {
             console.log('R done');
             if (err) console.log(err.toString('utf8'))
-            else {
-							console.log(data);
-              data = {result: 'R call succesful'};
-						}
+            else console.log(data);
+            if (!data) data = {result: 'R call succesful'}
             helpers.formatResponse({ response: data }, req, res);
         }
     );