Я запутался, как продолжаю получать результат Test1 для всех других информационных индексов, поэтому, если Test1 равен true, он будет продолжать печатать true на основе Test1, даже если Test2 и Test3 равны нулю
let info = ["Test1", "Test2", "Test3"];
isInfoAviable= (email) => {
payload.info = info
return axios.post(url, payload, axiosConfig).then((response) => {
return response.data.isAvailable ? true : null
}).catch((error) => {
console.log(error);
});
}
for (info of infos) {
isInfoAviable(info).then((res) => {
console.log(res) // If Test1 returns true, it'll true even if Test2 is null, why?
})
}