feat: when add/delete webhook trigger call the API (#24755)

This commit is contained in:
非法操作
2025-08-29 14:23:50 +08:00
committed by GitHub
parent a58df35ead
commit 19c0fc85e2
6 changed files with 39 additions and 23 deletions

View File

@ -63,6 +63,8 @@ import {
import { WorkflowHistoryEvent, useWorkflowHistory } from './use-workflow-history'
import useInspectVarsCrud from './use-inspect-vars-crud'
import { getNodeUsedVars } from '../nodes/_base/components/variable/utils'
import { deleteWebhookUrl } from '@/service/apps'
import { useStore as useAppStore } from '@/app/components/app/store'
// Entry node deletion restriction has been removed to allow empty workflows
@ -74,6 +76,7 @@ export const useNodesInteractions = () => {
const reactflow = useReactFlow()
const { store: workflowHistoryStore } = useWorkflowHistoryStore()
const { handleSyncWorkflowDraft } = useNodesSyncDraft()
const appId = useAppStore.getState().appDetail?.id
const {
checkNestedParallelLimit,
getAfterNodesInSameBranch,
@ -588,6 +591,18 @@ export const useNodesInteractions = () => {
return
deleteNodeInspectorVars(nodeId)
if (currentNode.data.type === BlockEnum.TriggerWebhook) {
if (appId) {
try {
deleteWebhookUrl({ appId, nodeId })
}
catch (error) {
console.error('Failed to delete webhook URL:', error)
}
}
}
if (currentNode.data.type === BlockEnum.Iteration) {
const iterationChildren = nodes.filter(node => node.parentId === currentNode.id)