This commit is contained in:
michael committed 2026-09-11 10:52:13 +02:00
1 parent 87d6c9b3ce
commit 9a08bfbf44
2 files changed
+47 -12

No files matched your search

+16 -4
View File
@@ -140,6 +140,10 @@ async function request<T>(url: string, options: ApiRequestInit = {}): Promise<T>
throw new ApiError("Anfrage hat zu lange gedauert", 408);
}
if (error instanceof TypeError) {
throw new ApiError("Verbindung zum Server wurde unterbrochen. Bitte prüfen, ob Backend und Frontend laufen und ob das Backup kleiner als das Upload-Limit ist.", 503);
}
throw error;
} finally {
if (timeout) {
@@ -223,14 +227,18 @@ export function createSetupAdmin(payload: { username: string; displayName: strin
export function restoreSetupBackup(sql: string) {
return request<{ ok: boolean }>("/api/setup/restore", {
method: "POST",
body: JSON.stringify({ sql })
timeoutMs: 10 * 60 * 1000,
headers: { "Content-Type": "text/plain; charset=utf-8" },
body: sql
});
}
export function validateSetupBackup(sql: string) {
return request<RestoreValidationResult>("/api/setup/restore/validate", {
method: "POST",
body: JSON.stringify({ sql })
timeoutMs: 10 * 60 * 1000,
headers: { "Content-Type": "text/plain; charset=utf-8" },
body: sql
});
}
@@ -287,14 +295,18 @@ export async function downloadDatabaseExport() {
export function restoreDatabaseBackup(sql: string) {
return request<{ ok: boolean }>("/api/admin/restore/database", {
method: "POST",
body: JSON.stringify({ sql })
timeoutMs: 10 * 60 * 1000,
headers: { "Content-Type": "text/plain; charset=utf-8" },
body: sql
});
}
export function validateDatabaseBackup(sql: string) {
return request<RestoreValidationResult>("/api/admin/restore/database/validate", {
method: "POST",
body: JSON.stringify({ sql })
timeoutMs: 10 * 60 * 1000,
headers: { "Content-Type": "text/plain; charset=utf-8" },
body: sql
});
}