📜  如何在 axios 中返回多个 Promise - Javascript 代码示例

📅  最后修改于: 2022-03-11 15:01:45.231000             🧑  作者: Mango

代码示例1
getRegistrations = async (event) => {
    let registrations = [];

    await event.registrations.forEach(registration => axios.get('/event/getRegistration', {
        params: {
            id: registration
        }
    }).then(res => {
            registrations.push(res.data.properties)
        }
    ).catch(err => console.log(err)));
    return registrations;
};