fix(bff): agregar endpoint /settings/demo-mode y proxy /api/v1 en Express Node.js y Flask API

This commit is contained in:
2026-09-23 16:42:11 -03:00
parent dd4a4c042a
commit 6907134c5e
6 changed files with 173 additions and 7 deletions
@@ -624,7 +624,14 @@ async function toggleDemoMode() {
},
body: JSON.stringify({ enabled: targetEnable })
});
const data = await res.json();
const contentType = res.headers.get('content-type') || '';
let data = {};
if (contentType.includes('application/json')) {
data = await res.json();
} else {
const rawText = await res.text();
throw new Error(res.ok ? 'Respuesta no válida' : `Error del servidor (${res.status})`);
}
if (res.ok) {
showAlert(data.message, targetEnable ? 'info' : 'success');
if (targetEnable) {