I go through all the elements of the array and form a request for each, how can I display a success message only after all requests have been completed?
saveAllPages() {
const allStagesData = JSON.parse(JSON.stringify(this.data.pages)).map(el => {
const id = el.id
apiService.postCurrentScript(el, id)
??? alert('success')
}
Maybe I should use Promise all, but how implement it here?