From b5a7662eb82817678e9723acf365df3b24298eab Mon Sep 17 00:00:00 2001 From: devlopersabbir Date: Wed, 25 Oct 2023 18:16:04 +0600 Subject: [PATCH] updated request body filter #4 --- routes/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/routes/index.js b/routes/index.js index a3bac23..1ae1735 100644 --- a/routes/index.js +++ b/routes/index.js @@ -55,7 +55,7 @@ router.post('/', function(req, res, next) { db.run('INSERT INTO todos (owner_id, title, completed) VALUES (?, ?, ?)', [ req.user.id, req.body.title, - req.body.completed == true ? 1 : null + req.body.filter == "completed" ? 1 : null ], function(err) { if (err) { return next(err); } return res.redirect('/' + (req.body.filter || ''));