{"size": 444, "ext": "js", "max_stars_repo_path": "server/routes/api/deleteTodo.js", "max_stars_repo_name": "reapedjuggler/MERN-toDo-App", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "server/routes/api/deleteTodo.js", "max_issues_repo_name": "reapedjuggler/MERN-toDo-App", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "server/routes/api/deleteTodo.js", "max_forks_repo_name": "reapedjuggler/MERN-toDo-App", "max_forks_repo_forks_event_min_datetime": "2021-05-13T16:33:38.000Z", "max_forks_repo_forks_event_max_datetime": "2021-07-29T07:44:27.000Z"}
{"max_stars_count": null, "max_issues_count": null, "max_forks_count": 2, "avg_line_length": 23.3684210526, "max_line_length": 65, "alphanum_fraction": 0.5563063063}
const route = require('express').Router();
const Todo = require('../../models/Todo');

route.delete('/', async (req, res, next) => {
    
    try {
        let data = Todo.findOneAndDelete({'_id': req.params.id});
        console.log("Todo deleted");
        res.send("Todo deleted");
    } catch (err) {
        console.log("Problem in deletion");
        res.send(" error in deletion");
    }

});
  
module.exports = exports = {
    route,
}