mirror of
https://github.com/Dvorinka/swingmusic-extended.git
synced 2026-06-04 12:33:03 +00:00
21 lines
523 B
TypeScript
21 lines
523 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;
|
|
},
|
|
updatePInfo(info: Playlist) {
|
|
this.info = info;
|
|
},
|
|
},
|
|
});
|