This function is to detect if there were no errors at the time of deleting the records but I call it from another function as well
if(!deleteAllSectionsPage(123) )
{
//alguna accion.
}
I have
function deleteAllSectionsPage(idpage)
{
Section.destroy(
{
where : {
page_id: idpage,
status : 1
}
}
).then(section => {
return true
}).catch(function (err) {
return false
});
}
but I do not return the Boolean value that is in
).then(section => {
return true
}).catch(function (err) {
return false
});
I do not know the truth because, I need knowledge in this type of situations, I have been looking for but I can not find it and I am lost in this. Can someone tell me how I can solve this?