I have some controllers where many callback functions are used instead of async await. I am using bluebird promise library to promisify. In callback function there are many mongoose methods like find, findOneAndUpdate.
But there is no option to append Async in front of theses methods. Is there any way to handle this. Or I'm I doing this the wrong way?
app.get('/acceptTeam/:TeamID', (req, res) => {
TeamTerms.findOneAndUpdate({ TeamID: req.params.TeamID }, { status: 'ACCEPTED' }).then(() => ).catch((err) => {
console.log(err);
return res.status(500).send();
});
});