modified code

This commit is contained in:
Matthis FAUVET 2024-06-21 16:40:36 +02:00
parent c41302ccde
commit f9c2338dd2

View File

@ -71,13 +71,12 @@
async list(){ async list(){
let data = await this.fetchData(); let data = await this.fetchData();
this.state = { this.state = {
placeholder: "Rechercher dans les songs",
items: data.results items: data.results
}; };
this.update(); this.update();
}, },
fetchData(){ fetchData(){
return fetch("https://dwarves.iut-fbleau.fr/~fauvet/api/songs").then(response => { return fetch("https://dwarves.iut-fbleau.fr/~fauvet/api/"+this.state.search).then(response => {
return response.json(); return response.json();
}); });
}, },