modified code

This commit is contained in:
Matthis FAUVET 2024-06-21 17:52:44 +02:00
parent 67e2afc4fe
commit 8c9be799b3

View File

@ -33,7 +33,6 @@
items: data.results, items: data.results,
search: "albums" search: "albums"
}; };
//console.log(this.state.items);
this.paintButton(); this.paintButton();
this.album_style = "isActivate"; this.album_style = "isActivate";
this.update(); this.update();
@ -64,7 +63,9 @@
this.song_style = "isActivate"; this.song_style = "isActivate";
this.state.search = "songs"; this.state.search = "songs";
} }
if(old_search != this.state.search){this.list();} if(old_search != this.state.search){
this.list();
}
this.update(); this.update();
}, },
async list(){ async list(){
@ -72,7 +73,6 @@
this.state = { this.state = {
items: data.results items: data.results
}; };
this.update();
}, },
fetchData(){ fetchData(){
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 => {