Reglage des prblms de la carte

This commit is contained in:
2026-03-18 13:44:30 +01:00
parent 31dc820b3f
commit 0dc766427b
5 changed files with 115 additions and 33 deletions
+19
View File
@@ -33,6 +33,7 @@
hasSearched: false,
results: [],
selected: null
selectedFormations: []
},
async launchSearch(query) {
@@ -73,6 +74,24 @@
})
},
addToSelection(index) {
const formation = this.state.results[index]
const selection = [...this.state.selectedFormations]
let exists = false
for (let i = 0; i < selection.length; i++) {
if (selection[i].id === formation.id) {
exists = true
}
}
if (!exists) {
selection.push(formation)
this.update({ selectedFormations: selection })
}
},
backToList() {
this.update({
selected: null