Procházet zdrojové kódy

Return meaningful response

jmacura před 5 roky
rodič
revize
07ee2a05fb
1 změnil soubory, kde provedl 2 přidání a 4 odebrání
  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);
         }
     );