I encountered an issue when attempting to check the checkbox on my to do list. An error message popped up saying "Model.findByIdAndRemove() no longer accepts a callback".
My goal is to have checked items automatically removed from the to do list.
app.post("/delete", function (req, res) {
const checkedItemId = req.body.checkbox;
Item.findByIdAndRemove(checkedItemId, function (err) {
if (!err) {
console.log("Successfully deleted checked item");
res.redirect("/");
}
});
});