I am using react and axios for post the data. and i want response in modal after post the data. currently i am getting data in console.log but i want to see these data in modal. currently i m using alert but getting undefined in alert.
axios.post("https://api_use.com/aof/upload/broker/existing/user/", data, options).then(res => {
console.log(res)
this.setState({ avatar: res.data.url, uploadPercentage: 100 }, ()=>{
setTimeout(() => {
this.setState({ uploadPercentage: 0 })
}, 1000);
console.log(res.data.failed)
**alert(console.log(res.data.failed));**
})
})