fix(bff): agregar endpoint /settings/demo-mode y proxy /api/v1 en Express Node.js y Flask API
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user