try to update items list

This commit is contained in:
Matthis FAUVET 2024-06-21 18:37:33 +02:00
parent d3c7ba896e
commit da90479b2b

View File

@ -35,7 +35,6 @@
};
this.paintButton();
this.album_style = "isActivate";
this.update();
},
onMounted(){
this.update();
@ -45,7 +44,6 @@
},
click(e) {
e.preventDefault();
this.paintButton();
switch(e.target.value){
case "Albums":
@ -63,19 +61,14 @@
this.song_style = "isActivate";
this.state.search = "songs";
}
this.fetchData(e)
this.fetchData()
this.update();
},
async fetchData(event){
event.preventDefault();
async fetchData(){
let data = await this.execQuery();
console.log(this.state.search);
console.log(data.results);
this.state = {
this.update({
items: data.results
};
console.log(this.state.items);
this.update();
});
},
execQuery(){
return fetch("https://dwarves.iut-fbleau.fr/~fauvet/api/"+this.state.search).then(response => {
@ -87,7 +80,6 @@
this.artist_style = "isDeactivate";
this.song_style = "isDeactivate";
}
}
</script>
<style>