Build Jellomator MVP
All checks were successful
docker / build-and-push (push) Successful in 49s

This commit is contained in:
Space-Banane
2026-05-20 20:36:28 +02:00
parent ce0dc0880c
commit 3991a01ec7
18 changed files with 3830 additions and 0 deletions

21
frontend/src/lib/api.ts Normal file
View File

@@ -0,0 +1,21 @@
export type SetupState = { needs_setup: boolean; current_user: { username: string } | null };
export type LinkItem = {
id: number;
name: string;
url: string;
description: string;
category: string;
enabled: boolean;
icon_url: string | null;
};
async function request<T>(path: string, init?: RequestInit): Promise<T> {
const res = await fetch(path, {
credentials: 'include',
headers: init?.body instanceof FormData ? undefined : { 'Content-Type': 'application/json', ...(init?.headers || {}) },
...init,
});
if (!res.ok) throw new Error(await res.text());
return res.status === 204 ? (undefined as T) : ((await res.json()) as T);
}
export const api = { request };