[client] add playlists and playlist page

This commit is contained in:
geoffrey45
2022-03-29 00:35:39 +03:00
parent e4640d9985
commit 69b691284d
15 changed files with 217 additions and 47 deletions
+15
View File
@@ -0,0 +1,15 @@
import { defineStore } from "pinia";
import { getPlaylist, getPTracks } from "../composables/playlists";
import { Track, Playlist } from "../interfaces";
export default defineStore("playlist-tracks", {
state: () => ({
playlist: <Playlist>{},
}),
actions: {
async fetchAll(playlistid: string) {
const playlist = await getPlaylist(playlistid);
this.playlist = playlist;
},
},
});
+4 -2
View File
@@ -7,8 +7,10 @@ export default defineStore("playlists", {
playlists: <Playlist[]>[],
}),
actions: {
fetchAll() {
async fetchAll() {
const playlists = await getAllPlaylists();
this.playlists = playlists;
},
},
});