removed console.log and fixed onDeleteBug

This commit is contained in:
anovazzi1 2023-05-03 20:15:43 -03:00 committed by Gabriel Luiz Freitas Almeida
commit 52df6d9152
2 changed files with 2 additions and 5 deletions

View file

@ -34,7 +34,6 @@ export default function GenericNode({
const { reactFlowInstance } = useContext(typesContext);
const [params, setParams] = useState([]);
console.log();
useEffect(() => {
if (reactFlowInstance) {
@ -53,15 +52,13 @@ export default function GenericNode({
body: JSON.stringify(reactFlowInstance.toObject()),
});
console.log(response.status, response.body);
if (response.status === 200) {
setValidationStatus("success");
} else if (response.status === 500) {
setValidationStatus("error");
}
} catch (error) {
console.error("Error validating node:", error);
// console.error("Error validating node:", error);
setValidationStatus("error");
}
}, 1000), // Adjust the debounce delay (500ms) as needed

View file

@ -158,7 +158,7 @@ export default function FlowPage({ flow }:{flow:FlowType}) {
const onDelete = (mynodes) => {
setEdges(
edges.filter(
(ns) => !nodes.some((n) => ns.source === n.id || ns.target === n.id)
(ns) => !mynodes.some((n) => ns.source === n.id || ns.target === n.id)
)
);
};