diff --git a/index.js b/index.js index 5a0e81d..529b2ad 100644 --- a/index.js +++ b/index.js @@ -75,7 +75,7 @@ app.post('/upload/task', upload.single('file'), (req, res) => { const oldPath = req.file.path; const newPath = dir + "/" + req.file.filename; - + var result_list =''; fs.rename(oldPath, newPath, function (err) { if (err) throw err console.log('Successfully renamed - AKA moved!'); @@ -100,11 +100,12 @@ app.post('/upload/task', upload.single('file'), (req, res) => { console.log("DataError - > ", dbErr.toString()); }else{ console.log("DB Result - > " , result.rows); + result_list = result.rows; } console.log('End::Database Registration!'); }) - - return res.status(200).send('Completed') + return res.status(200).json({'status': 'Completed', 'internal_return': 0, 'result_list': result_list }) + //return res.status(200).send('Completed') }) })