Попробуйте так.
const tasks = [{ path: 'http://domain.com/api/1', data: {} }, { path: 'http://domain.com/api/2', data: {} }, { path: 'http://domain.com/api/3', data: {} }];
const delay = () => new Promise(resolve => setTimeout(resolve, 1000));
const createRequest = async (path, data) => {
await delay();
return axios.post(path, data)
.then((response) => ({ postData: data, result: response?.data }))
.catch((err) => {
console.log(err);
return err;
});
}
const processTasks = async (array) => {
for (const item of array) {
const result = await createRequest(item?.path, item?.data);
console.log('result:', result);
}
}
processTasks(tasks);