implement clearing search input on start typing

+ rename pages folder to fetch in composables folder
This commit is contained in:
geoffrey45
2022-08-02 23:58:05 +03:00
parent ef2926f18f
commit c562e529fd
14 changed files with 16 additions and 14 deletions
+30
View File
@@ -0,0 +1,30 @@
import { Folder, Track } from "@/interfaces";
import state from "../state";
import useAxios from "../useAxios";
export default async function (path: string) {
interface FolderData {
tracks: Track[];
folders: Folder[];
}
const { data, error } = await useAxios({
url: `${state.settings.uri}/folder`,
props: {
folder: path,
},
});
if (error) {
console.error(error);
}
if (data) {
return data as FolderData;
}
return <FolderData>{
tracks: [],
folders: [],
};
}