diff --git a/stores/workflow/workflow-store.ts b/stores/workflow/workflow-store.ts index 7b133abc79..e0c91d872b 100644 --- a/stores/workflow/workflow-store.ts +++ b/stores/workflow/workflow-store.ts @@ -28,7 +28,7 @@ export const useWorkflowStore = create()( canUndo: () => false, canRedo: () => false, - updateSubBlock: (blockId: string, subBlockId: string, subBlock: SubBlockState) => { + updateSubBlock: (blockId: string, subBlockId: string, value: any) => { set((state) => ({ blocks: { ...state.blocks, @@ -36,11 +36,13 @@ export const useWorkflowStore = create()( ...state.blocks[blockId], subBlocks: { ...state.blocks[blockId].subBlocks, - [subBlockId]: subBlock, + [subBlockId]: { + ...state.blocks[blockId].subBlocks[subBlockId], + value, + }, }, }, }, - edges: [...state.edges], })) },