mirror of
https://github.com/langgenius/dify.git
synced 2026-05-04 17:38:04 +08:00
fix: in pipeline not show the node config right
This commit is contained in:
@ -24,10 +24,19 @@ export const usePipelineConfig = () => {
|
|||||||
handleUpdateWorkflowConfig,
|
handleUpdateWorkflowConfig,
|
||||||
)
|
)
|
||||||
|
|
||||||
const handleUpdateNodesDefaultConfigs = useCallback((nodesDefaultConfigs: Record<string, any>) => {
|
const handleUpdateNodesDefaultConfigs = useCallback((nodesDefaultConfigs: Record<string, any> | Record<string, any>[]) => {
|
||||||
const { setNodesDefaultConfigs } = workflowStore.getState()
|
const { setNodesDefaultConfigs } = workflowStore.getState()
|
||||||
|
let res: Record<string, any> = {}
|
||||||
|
if (Array.isArray(nodesDefaultConfigs)) {
|
||||||
|
nodesDefaultConfigs.forEach((item) => {
|
||||||
|
res[item.type] = item.config
|
||||||
|
})
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
res = nodesDefaultConfigs as Record<string, any>
|
||||||
|
}
|
||||||
|
|
||||||
setNodesDefaultConfigs!(nodesDefaultConfigs)
|
setNodesDefaultConfigs!(res)
|
||||||
}, [workflowStore])
|
}, [workflowStore])
|
||||||
useWorkflowConfig(
|
useWorkflowConfig(
|
||||||
pipelineId ? `/rag/pipelines/${pipelineId}/workflows/default-workflow-block-configs` : '',
|
pipelineId ? `/rag/pipelines/${pipelineId}/workflows/default-workflow-block-configs` : '',
|
||||||
|
|||||||
Reference in New Issue
Block a user