mirror of
https://github.com/Dvorinka/swingmusic-extended.git
synced 2026-06-03 20:13:02 +00:00
6cf9a58d6d
🔷 move upNext card into separate component 🔷 a lot of refactors
18 lines
458 B
TypeScript
18 lines
458 B
TypeScript
import { defineStore } from "pinia";
|
|
import { getPlaylist } from "../composables/playlists";
|
|
import { Track, Playlist } from "../interfaces";
|
|
|
|
export default defineStore("playlist-tracks", {
|
|
state: () => ({
|
|
info: <Playlist>{},
|
|
tracks: <Track[]>[],
|
|
}),
|
|
actions: {
|
|
async fetchAll(playlistid: string) {
|
|
const playlist = await getPlaylist(playlistid);
|
|
this.info = playlist.info;
|
|
this.tracks = playlist.tracks;
|
|
},
|
|
},
|
|
});
|