I have this function
function deleteItem() {
deleteInvItems({
where: {
invoice_id: invData.invNo,
[Op.not]: [{
item_id: itemIDs
}]
}
}).then(resp => {
if (!resp) return false;
});
deleteInvSumItems([{
where: {
invoice_id: invData.invNo,
[Op.not]: [{
hsn_code: invUniqueHsnCodes
}]
}
}]).then(resp => {
if (!resp) return false;
});
return true;
}
I want to exit the function with return false; if I get false response from server.
But if I call inner functions without return keyword unlike return deleteInvItems({...}) and return deleteInvSumItems({...}). I'm not able to exit the parent function.
How can I exit the parent function deleteItem() with retuning false if I get false response from server?