Всем привет. Помогите понят почему мой промис выполняет и then и catch? Вроде ж все правильно, так еще и нода ругается что я catch не обработал...
router.post('/update/:id', (req, res) => {
const id =
req.params.id;
if (regexpID.test(id)) {
sql.update(req.body, id)
.then(res.status(200).end(console.log('удачно')))
.catch((err) => res.status(400).end(console.log(err)));
} else {
res.status(400).json({ 'err': 'ID incorrect' });
}
});