Reglage des prblms de la carte
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user