🐛 Fixed storage

This commit is contained in:
Mawoka
2023-06-18 10:09:15 +02:00
parent 5f35adeec7
commit cebc43fc3b
5 changed files with 15 additions and 14 deletions
+6 -1
View File
@@ -9,7 +9,12 @@ import type { PrivateImageData } from '$lib/quiz_types';
export const load = (async ({ fetch }) => {
const res = await fetch('/api/v1/storage/list');
const res2 = await fetch('/api/v1/storage/limit');
const json: PrivateImageData[] = await res.json();
let json: PrivateImageData[];
if (res.ok) {
json = await res.json();
} else {
json = [];
}
const storage_usage: { limit: number; limit_reached: boolean; used: number } =
await res2.json();
return {