mirror of
https://github.com/Dvorinka/swingmusic-extended.git
synced 2026-06-05 13:03:02 +00:00
rename files and set max client width on viewport
This commit is contained in:
@@ -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: [],
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user