Adi – 18-39 Feb 8

I am trying to make API call after some delay with 3-5 secs but it fails everytime any idea why it is happening? Any suggestions for improvement?
async function foo(account_id, id, oauth_access_token) {
return new Promise((resolve, reject) => {
setTimeout(async () => {
const result = await axios.post(`API`)
resolve(result);
}, 5000);
});
}
async function foo(account_id, id, oauth_access_token) {
return new Promise((resolve, reject) => {
setTimeout(async () => {
const result = await axios.post(`API`)
resolve(result);
}, 5000);
});
}
S
ScriptyChris799d ago
what do you mean by "it fails every time"? What exactly happens?
UU
Unknown User799d ago