Skip to content

Commit

Permalink
adding new function
Browse files Browse the repository at this point in the history
  • Loading branch information
Leo Shah committed Feb 29, 2024
1 parent 7bba785 commit bb5fb01
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions routes/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,19 @@ exports.destroy = function (req, res, next) {
});
};

exports.destroy1 = function (req, res, next) {
Todo.findById(req.params.id, function (err, todo) {

try {
todo.remove(function (err, todo) {
if (err) return next(err);
res.redirect('/');
});
} catch (e) {
}
});
};

exports.edit = function (req, res, next) {
Todo.
find({}).
Expand Down

0 comments on commit bb5fb01

Please sign in to comment.