I have the next JSX code
let answer = true;
var postAxios = axios({
method: 'post',
url: httpLink,
params: {table: tableName},
data: rowInfo
}
)
.then(function (response) {
console.log(response);
alert(response);
answer = true;
})
.catch(function (error) {
console.log(error);
alert(error);
answer = false;
});
return answer;
on the final value for answer some transaction needs to be continued (answer==true) or stopped(answer==false). The problem I have is that answer is always true inclusive when the catch section is executed. Is there a way to arrange this?