fin projet
This commit is contained in:
@@ -26,6 +26,8 @@
|
||||
</footer>
|
||||
</div>
|
||||
</a>
|
||||
<a if={item.type === "release"} href={"#/release-details/master/" + item.master_id}><button>master</button></a>
|
||||
<a if={item.type === "master"} href="#"><button onclick={() => this.MainReleaseDetails(item)}>release</button></a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -60,7 +62,6 @@
|
||||
|
||||
this.state.favorites.items = items;
|
||||
this.state.loading = false;
|
||||
console.log(this.state)
|
||||
this.update();
|
||||
},
|
||||
|
||||
@@ -68,6 +69,19 @@
|
||||
await window.removeFavorite(id, type);
|
||||
this.state.favorites.items = this.state.favorites.items.filter(item => item.id !== id);
|
||||
this.update();
|
||||
},
|
||||
|
||||
async MainReleaseDetails(item) {
|
||||
const res = await fetch(item.resource_url);
|
||||
const json = await res.json();
|
||||
|
||||
const mainUrl = json.main_release_url;
|
||||
|
||||
const res2 = await fetch(mainUrl);
|
||||
const releaseData = await res2.json();
|
||||
|
||||
console.log(releaseData);
|
||||
window.location.hash = `#/release-details/release/${releaseData.id}`;
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user