build artist page

+ connect artist page to backend
~ bugs introduced as there are hashing changes in the backend

[will fix later]
This commit is contained in:
geoffrey45
2022-12-03 16:06:26 +03:00
committed by Mungai Njoroge
parent fff2c53801
commit 075765088f
17 changed files with 382 additions and 82 deletions
+21
View File
@@ -0,0 +1,21 @@
import { defineStore } from "pinia";
import { Artist, Album, Track } from "@/interfaces";
import { getArtistData } from "@/composables/fetch/artists";
export default defineStore("artistPage", {
state: () => ({
info: <Artist>{},
albums: <Album[]>[],
tracks: <Track[]>[],
}),
actions: {
async getData(hash: string) {
const { artist, albums, tracks } = await getArtistData(hash);
this.info = artist;
this.albums = albums;
this.tracks = tracks;
},
},
});