Skip to content
Snippets Groups Projects
Commit 8f596914 authored by ali asaria's avatar ali asaria
Browse files

fix moving nodes

parent 2cecf99f
No related branches found
No related tags found
No related merge requests found
...@@ -131,19 +131,22 @@ const Flow = ({ ...@@ -131,19 +131,22 @@ const Flow = ({
return () => clearTimeout(timer); return () => clearTimeout(timer);
}, [reactFlowInstance, selectedWorkflow]); }, [reactFlowInstance, selectedWorkflow]);
const onNodeDragStop = useCallback(async (event, node) => { const onNodeDragStop = useCallback(
const metadata = JSON.stringify({ async (event, node) => {
position: node.position, const metadata = JSON.stringify({
}); position: node.position,
await fetch( });
chatAPI.Endpoints.Workflows.EditNodeMetadata( await fetch(
workflowId, chatAPI.Endpoints.Workflows.EditNodeMetadata(
node?.id, workflowId,
metadata node?.id,
) metadata
); )
mutateWorkflows(); );
}, []); mutateWorkflows();
},
[selectedWorkflow]
);
return ( return (
<ReactFlow <ReactFlow
...@@ -184,7 +187,7 @@ const Flow = ({ ...@@ -184,7 +187,7 @@ const Flow = ({
}} }}
startDecorator={<PlusCircleIcon strokeWidth={2} size={32} />} startDecorator={<PlusCircleIcon strokeWidth={2} size={32} />}
> >
Add Node Add Node {workflowId}
</Button> </Button>
<Background color="#96ADE9" /> <Background color="#96ADE9" />
<Controls> <Controls>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment