j'arrive pas a commit
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
import * as riot from 'riot'
|
||||
import LigneResultat from './components/ligne-resultat.riot'
|
||||
import { recupereFormations } from './api/parcoursup.js'
|
||||
|
||||
|
||||
riot.register('ligne-resultat', LigneResultat)
|
||||
|
||||
const bouton = document.getElementById("entrerRequete")
|
||||
const champRecherche = document.getElementById("requete")
|
||||
const divResultats = document.getElementById("affichageResultats")
|
||||
|
||||
bouton.addEventListener("click", async () => {
|
||||
const motCle = champRecherche.value
|
||||
divResultats.innerHTML = "Chargement..."
|
||||
|
||||
const formations = await recupereFormations(motCle)
|
||||
|
||||
divResultats.innerHTML = ""
|
||||
|
||||
formations.forEach(f => {
|
||||
const listeFormations = riot.mount(
|
||||
document.createElement('ligne-resultat'),
|
||||
{ formation: f }
|
||||
)
|
||||
divResultats.appendChild(listeFormations[0].root)
|
||||
})
|
||||
})
|
||||
Reference in New Issue
Block a user