I'm working with an external API (specifically OnlyOffice, if that info can be of any help) using Axios and promises. This particular API works asynchronously, and so returns an object which has to be replenished after the task is finished. My question is, how can I wait for that response to change?
The response has status 200 but with a boolean field that, when I got the request's 200 response, is false. I need to wait till the API replenishes the response with the boolean set as true. How can I wait for that change to happen if when I get a 200 response I already exit the promise with a success through .then()? This is how it looks right now:
await request(data, token)
.then(response => {
//response is 200 but with bool : 0
//I need to wait for a bool : 1
})
.catch(error => {});