mirror of
https://github.com/Dvorinka/swingmusic-extended.git
synced 2026-06-04 20:43:04 +00:00
move page stores into pages folder
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
import { defineStore } from "pinia";
|
||||
import { Folder, Track } from "../../interfaces";
|
||||
|
||||
import fetchThem from "../../composables/getFilesAndFolders";
|
||||
|
||||
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 = path;
|
||||
this.dirs = folders;
|
||||
this.tracks = tracks;
|
||||
},
|
||||
},
|
||||
});
|
||||
Reference in New Issue
Block a user