Files
swingmusic-extended/src/composables/fetch/folders.ts
T
geoffrey45 94eb198e47 major redesign and refactor
+ centralized urls
+ reduce max app width
+ bump up header height to 23rem
2022-09-15 12:36:30 +03:00

31 lines
513 B
TypeScript

import { paths } from "@/config";
import { Folder, Track } from "@/interfaces";
import useAxios from "./useAxios";
export default async function (path: string) {
interface FolderData {
tracks: Track[];
folders: Folder[];
}
const { data, error } = await useAxios({
url: paths.api.folder,
props: {
folder: path,
},
});
if (error) {
console.error(error);
}
if (data) {
return data as FolderData;
}
return <FolderData>{
tracks: [],
folders: [],
};
}