Add flow update to database
This commit is contained in:
parent
2fb72b1d1e
commit
7912f846a6
1 changed files with 11 additions and 0 deletions
|
|
@ -9,6 +9,7 @@ import {
|
|||
applyNodeChanges,
|
||||
} from "reactflow";
|
||||
import { create } from "zustand";
|
||||
import { updateFlowInDatabase } from "../controllers/API";
|
||||
import {
|
||||
NodeDataType,
|
||||
NodeType,
|
||||
|
|
@ -344,6 +345,16 @@ const useFlowStore = create<FlowStoreType>((set, get) => ({
|
|||
function handleBuildUpdate(data: any) {
|
||||
get().addDataToFlowPool(data.data[data.id], data.id);
|
||||
}
|
||||
await updateFlowInDatabase({
|
||||
data: {
|
||||
nodes: get().nodes,
|
||||
edges: get().edges,
|
||||
viewport: get().reactFlowInstance?.getViewport()!,
|
||||
},
|
||||
id: currentFlow!.id,
|
||||
name: currentFlow!.name,
|
||||
description: currentFlow!.description,
|
||||
});
|
||||
return buildVertices({
|
||||
flowId: currentFlow!.id,
|
||||
nodeId,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue