quck
This commit is contained in:
@@ -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",
|
||||
|
||||
Reference in New Issue
Block a user