modified code
This commit is contained in:
parent
67e2afc4fe
commit
8c9be799b3
@ -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 => {
|
||||||
|
Loading…
Reference in New Issue
Block a user