import { defineStore } from "pinia"; import { getPlaylist } from "../composables/playlists"; import { Track, Playlist } from "../interfaces"; export default defineStore("playlist-tracks", { state: () => ({ info: {}, tracks: [], }), actions: { async fetchAll(playlistid: string) { const playlist = await getPlaylist(playlistid); this.info = playlist.info; this.tracks = playlist.tracks; }, }, });