Files
swingmusic-extended/src/stores/p.ptracks.ts
T
geoffrey45 6cf9a58d6d 🔷 add PlayingFrom component to right sidebar
🔷 move upNext card into separate component
🔷 a lot of refactors
2022-04-03 21:47:57 +03:00

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;
},
},
});