I have a page that waits for a specific status from the server.
The thing is, that the server has statuses - (Enabled, In_Progress, Disabled), and it returns 200 also for In_Progress.
I thought about async but the problem is that the server will return a response in case of In_Progress.
Is there any way to wait until the API will return "Enabled"? Or I have to send a request every X seconds?
EDIT
I have an option to change the response (502 instead of 200) on the server-side if it helps.
Thanks