move page stores into pages folder

This commit is contained in:
geoffrey45
2022-06-10 17:08:29 +03:00
parent 67d19fb6e3
commit 75123f5384
18 changed files with 60 additions and 61 deletions
+21
View File
@@ -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;
},
},
});