🪄 Adds api service with updates

This commit is contained in:
Rune Harlyk
2024-05-08 13:26:40 +02:00
committed by Rune Harlyk
parent 4c66c428e6
commit b7ae17f3bf
19 changed files with 391 additions and 573 deletions
@@ -3,11 +3,12 @@
import Spinner from "$lib/components/Spinner.svelte";
import FolderIcon from '~icons/mdi/folder-outline';
import Folder from "./Folder.svelte";
import { api } from "$lib/api";
const getFiles = async () => {
const response = await fetch('/api/files/list');
if (response.ok) {
return response.json();
const result = await api.get('/api/files/list')
if (result.isOk()) {
return result.inner;
}
};
</script>