Respuesta correcta de la api

This commit is contained in:
Alexis
2026-03-24 09:07:21 +01:00
parent fec5773928
commit 08666eebee
+5 -12
View File
@@ -12,10 +12,13 @@ function App() {
const handleCalculate = async () => { const handleCalculate = async () => {
setIsLoading(true); setIsLoading(true);
setResult(null); setResult(null);
const firstIndex = "0";
const lastIndex = (levels.length - 1).toString();
const currentReferences = { const currentReferences = {
[levels[0]]: 0, [firstIndex]: 0,
[levels[levels.length - 1]]: 1 [lastIndex]: 1
}; };
const payload = { const payload = {
@@ -200,16 +203,6 @@ function App() {
</button> </button>
</div> </div>
{/* --- NUEVO: CAJA PARA VER EL RESULTADO (TEMPORAL PARA DEBUG) --- */}
{result && (
<div className="w-full max-w-2xl mt-8 p-6 bg-slate-800 text-green-400 rounded-xl overflow-x-auto shadow-inner">
<h3 className="text-white font-bold mb-2">Respuesta del Backend:</h3>
<pre className="text-sm font-mono">
{JSON.stringify(result, null, 2)}
</pre>
</div>
)}
</div> </div>
); );
} }