diff --git a/library-express/titles.js b/library-express/titles.js index a090227..eb7ef0b 100644 --- a/library-express/titles.js +++ b/library-express/titles.js @@ -26,7 +26,7 @@ module.exports = function(){ } } }); - + /* Adds a title, redirects to the title page after adding */ router.post('/', function(req, res){ console.log(req.body); @@ -41,13 +41,12 @@ module.exports = function(){ sql = mysql.pool.query(sql, inserts, function(error, results, fields){ if(error){ console.log(JSON.stringify(error)); - res.write(JSON.stringify(error)); - res.end(); + res.send(""); } else{ res.redirect('/titles'); } }); }); - + return router; }(); \ No newline at end of file