🐛 Fixed storage
This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user