modified code

This commit is contained in:
Matthis FAUVET 2024-06-21 18:09:53 +02:00
parent bd8eb9681f
commit 04f906baef

View File

@ -68,14 +68,14 @@
}, },
async fetchData(){ async fetchData(){
let data = await this.execQuery(); let data = await this.execQuery();
console.log(this.state.search);
console.log(this.state.items);
this.state = { this.state = {
items: data.results items: data.results
}; };
}, },
execQuery(){ execQuery(){
return fetch("https://dwarves.iut-fbleau.fr/~fauvet/api/"+this.state.search).then(response => { return fetch("https://dwarves.iut-fbleau.fr/~fauvet/api/"+this.state.search).then(response => {
console.log(this.state.search);
console.log(response.json());
return response.json(); return response.json();
}); });
}, },