mirror of
https://github.com/Dvorinka/swingmusic-extended.git
synced 2026-06-04 04:23:01 +00:00
c562e529fd
+ rename pages folder to fetch in composables folder
20 lines
482 B
TypeScript
20 lines
482 B
TypeScript
import { defineStore } from "pinia";
|
|
import { Folder, Track } from "../../interfaces";
|
|
|
|
import fetchThem from "../../composables/fetch/folders";
|
|
|
|
export default defineStore("FolderDirs&Tracks", {
|
|
state: () => ({
|
|
path: <string>{},
|
|
dirs: <Folder[]>[],
|
|
tracks: <Track[]>[],
|
|
}),
|
|
actions: {
|
|
async fetchAll(path: string) {
|
|
const { tracks, folders } = await fetchThem(path);
|
|
|
|
[this.path, this.dirs, this.tracks] = [path, folders, tracks];
|
|
},
|
|
},
|
|
});
|