fix: change existing node to a webhook node raise 404 (#28686)

This commit is contained in:
非法操作
2025-11-26 22:41:52 +08:00
committed by GitHub
parent 6b8c649876
commit 6635ea62c2
2 changed files with 16 additions and 2 deletions

View File

@@ -59,6 +59,7 @@ import {
useWorkflowHistory,
} from './use-workflow-history'
import { useNodesMetaData } from './use-nodes-meta-data'
import { useAutoGenerateWebhookUrl } from './use-auto-generate-webhook-url'
import type { RAGPipelineVariables } from '@/models/pipeline'
import useInspectVarsCrud from './use-inspect-vars-crud'
import { getNodeUsedVars } from '../nodes/_base/components/variable/utils'
@@ -94,6 +95,7 @@ export const useNodesInteractions = () => {
const { nodesMap: nodesMetaDataMap } = useNodesMetaData()
const { saveStateToHistory, undo, redo } = useWorkflowHistory()
const autoGenerateWebhookUrl = useAutoGenerateWebhookUrl()
const handleNodeDragStart = useCallback<NodeDragHandler>(
(_, node) => {
@@ -1401,7 +1403,14 @@ export const useNodesInteractions = () => {
return filtered
})
setEdges(newEdges)
handleSyncWorkflowDraft()
if (nodeType === BlockEnum.TriggerWebhook) {
handleSyncWorkflowDraft(true, true, {
onSuccess: () => autoGenerateWebhookUrl(newCurrentNode.id),
})
}
else {
handleSyncWorkflowDraft()
}
saveStateToHistory(WorkflowHistoryEvent.NodeChange, {
nodeId: currentNodeId,
@@ -1413,6 +1422,7 @@ export const useNodesInteractions = () => {
handleSyncWorkflowDraft,
saveStateToHistory,
nodesMetaDataMap,
autoGenerateWebhookUrl,
],
)