Why 'then' and 'catch' is both called if I add callback function?
function sendMail(data, callback) {
sgMail
.send(data)
.then(() => {
console.log('Email sent');
callback(true);
})
.catch((error) => {
console.error(error);
callback(false);
})
}
I'm sorry if its duplicate I just cant find an answer.