fix: arreglar petición para borrar gráficas en el historial.

This commit is contained in:
Alexis
2026-04-15 11:12:40 +02:00
parent 0c1d446139
commit b077106326
2 changed files with 5 additions and 4 deletions
+3 -2
View File
@@ -35,8 +35,9 @@ export default function History() {
await deleteHistoryItem(id);
setHistoryItems(prev => prev.filter(item => item._id !== id && item.id !== id));
if (expandedId === id) setExpandedId(null);
} catch (error) {
alert("Error al borrar: " + error);
} catch (err) {
const errorMessage = err.response?.data?.detail || err.message || "Error desconocido";
alert("Error al borrar: " + errorMessage);
}
};