0๐
โ
To use await
in those callbacks, each callback function itself needs to be async
:
export default {
methods: {
submitToTheOthers(){
โฎ
return this.idxs.map( (_entry, i) => {
return updateGeneralInfoToOther(1, data, this.serverFullAddress[i]).then(async (res) => { // [here2]
โ
๐
await someAsyncMethod()
if (res.status == 200) {
โฎ
if (logoData.logo) {
this.sendFileToOther(/*...*/).then(async (res) => { // [here]
โ
๐
await someAsyncMethod()
})
}
if (logoData.logo1) {
this.sendFileToOther(/*...*/).then(async (res) => { // [here]
โ
๐
await someAsyncMethod()
})
}
}
})
})
},
},
}
Source:stackexchange.com