I'm currently developing a Vue.js project that is connected to a Lumen API and everything is functioning smoothly.
Within this project, I have implemented a list of students ('Etudiants') that allows users to select and delete a student by clicking on the list and using a button in the toolbar, respectively.
Upon deleting a student, I need to refresh the student list as it becomes outdated. This requires making two API calls using Axios:
- DELETE (param: idEtudiant)
- GET (param: page)
The issue arises when the API calls are not executed in the correct order, as depicted in the waterfall diagram below:
https://i.sstatic.net/2RAOa.png
This problem involves three Vue.js files:
'Etudiants.vue' and its two child components: 'ListeEtudiants.vue' (student list) and 'BarreOutilsEtudiant.vue' (toolbar)
https://i.sstatic.net/3mnKB.png
The visual representation above shows the hierarchy of these three files and the ideal execution order.
In my case, the third action, which is the Axios DELETE request, is being executed last instead of in the correct sequence.
Below are the contents of the files involved:
Etudiants.vue:
[Contents of Etudiants.vue file]
ListeEtudiants.vue:
[Contents of ListeEtudiants.vue file]
BarreOutilsEtudiant.vue:
[Contents of BarreOutilsEtudiant.vue file]
Your assistance in resolving this issue is greatly appreciated. Thank you for your help!