mirror of
https://github.com/Dvorinka/swingmusic-extended.git
synced 2026-06-04 12:33:03 +00:00
[client] add playlists and playlist page
This commit is contained in:
@@ -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;
|
||||
},
|
||||
},
|
||||
});
|
||||
@@ -7,8 +7,10 @@ export default defineStore("playlists", {
|
||||
playlists: <Playlist[]>[],
|
||||
}),
|
||||
actions: {
|
||||
fetchAll() {
|
||||
|
||||
async fetchAll() {
|
||||
const playlists = await getAllPlaylists();
|
||||
|
||||
this.playlists = playlists;
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user