Respuesta correcta de la api
This commit is contained in:
+5
-12
@@ -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>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user