mirror of
https://github.com/Dvorinka/swingmusic-extended.git
synced 2026-06-05 13:03:02 +00:00
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:
committed by
Mungai Njoroge
parent
fff2c53801
commit
075765088f
@@ -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;
|
||||
},
|
||||
},
|
||||
});
|
||||
Reference in New Issue
Block a user