This commit is contained in:
2025-11-30 01:48:31 +01:00
parent e6ab5a0a1f
commit 3ebfb8c7f6
4 changed files with 187 additions and 3 deletions

View File

@@ -885,7 +885,12 @@
// --- Backend-Speicherung ------------------------------------------------
async function saveReportToBackend(report) {
const url = "/api/result/browser-quick-test.php";
// apiBase kommt aus fakecheck.core.js (detectApiBase)
const apiBase = (cfg && cfg.apiBase) ? cfg.apiBase : "";
const base = apiBase.replace(/\/+$/, "");
// Fallback: falls apiBase aus irgendeinem Grund leer ist, lokal auf /api routen
const url = base ? (base + "/browser.quick.test") : "/api/browser.quick.test";
try {
const response = await fetch(url, {
method: "POST",
@@ -913,6 +918,24 @@
}
const data = await response.json().catch(() => null);
if (!data || data.ok !== true) {
logLine(
tFmt(
"fake_ui.log_backend_save_error_payload",
"Backend: Testergebnis wurde nicht bestätigt{suffix}.",
{
suffix: data && data.error
? ` (${data.error})`
: ""
}
),
"warn"
);
if (saveError) saveError.style.display = "block";
return;
}
logLine(
tFmt(
"fake_ui.log_backend_save_ok",