Is there a way to trigger the last axios call only after getting both ID_AnUniversitarAbsolvire and ID_Facultate? I attempted to create a function within watch: {}, but it was unsuccessful. Any suggestions on how to achieve this would be greatly appreciated.
<v-col class="d-flex" cols="12" sm="4">
<v-select
:items="anUniversitar"
item-text="Denumire"
item-value="ID_AnUniv"
label="An Universitar"
v-model="ID_AnUnivAbsolvire"
:rules="[v => !!v || 'Alege un an universitar']"
></v-select>
</v-col>
<v-col class="d-flex" cols="12" sm="4">
<v-select
:items="facultateList"
item-text="Denumire"
item-value="ID_Facultate"
label="Facultate"
v-model="ID_Facultate"
:rules="[v => !!v || 'Alege facultatea']"
></v-select>
</v-col>
data: () => ({
ID_AnUnivAbsolvire: '',
ID_Facultate: '',
}),
methods: {
},
created() {
axios.get('http://193.254.231.70/api/agsis.api/AnUniversitar/AnUniversitar_GetCurrentAndPrevious')
.then(res => {
const data = res.data;
for(const item of data) {
this.anUniversitar.push(item);
}
}),
axios.get('http://193.254.231.70/api/agsis.api/Facultate/FacultateList')
.then(res => {
const data = res.data;
for(const item of data) {
this.facultateList.push(item);
}
}),
axios.get(`http://193.254.231.70/api/agsis.api/Facultate/SpecializareListByFacultateAnUniv?ID_Facultate=${this.ID_Facultate}&ID_AnUniv=${this.ID_AnUnivAbsolvire}`)
.then(res => {
const data = res.data;
for(const item of data) {
this.specializareFacultate.push(item);
}
})
},