Преглед на файлове

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);
         }
     );