Is there a way to make 'submitToTheOthers' function run after 'let items = []' has completed, without needing an await within 'submitToTheOthers'? I am considering using await within the for loop in 'submitToTheOthers', but I'm unsure how to do so.
If I were to use await within 'updateGeneralInfoToOther', it would mean that each server would not be updated simultaneously, and if any server encounters an error, the process would halt. Is there a better approach involving promises or another method to handle this situation?
Any suggestions on how to ensure that 'submitToTheOthers' waits before executing further actions?
PS) I am particularly interested in older syntaxes as I may need to support Internet Explorer XD XD TT
Settings.vue
<template>
<div>
<button class="point" @click="submitTotalServer()">submitTotalServer</button>
</div>
</template>
... (omitted for brevity)
api/settings.js
// ...
export function updateGeneralInfoToOther(id, data, serverAddress) {
axios.defaults.timeout = 5000;
data.serverAddress = serverAddress
return axios.post(`/api/settings/generalToOther/${id}`, data)
}
// ...