mirror of https://github.com/langgenius/dify.git
fix: in pipeline not show the node config right
This commit is contained in:
parent
c4f0691454
commit
c8d60f372d
|
|
@ -24,10 +24,19 @@ export const usePipelineConfig = () => {
|
|||
handleUpdateWorkflowConfig,
|
||||
)
|
||||
|
||||
const handleUpdateNodesDefaultConfigs = useCallback((nodesDefaultConfigs: Record<string, any>) => {
|
||||
const handleUpdateNodesDefaultConfigs = useCallback((nodesDefaultConfigs: Record<string, any> | Record<string, any>[]) => {
|
||||
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])
|
||||
useWorkflowConfig(
|
||||
pipelineId ? `/rag/pipelines/${pipelineId}/workflows/default-workflow-block-configs` : '',
|
||||
|
|
|
|||
Loading…
Reference in New Issue