chore: improve webhook (#25998)

This commit is contained in:
非法操作
2025-09-21 12:16:31 +08:00
committed by GitHub
parent 59f56d8c94
commit 4ca14bfdad
5 changed files with 7 additions and 27 deletions

View File

@ -63,8 +63,6 @@ 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
@ -76,7 +74,7 @@ export const useNodesInteractions = () => {
const reactflow = useReactFlow()
const { store: workflowHistoryStore } = useWorkflowHistoryStore()
const { handleSyncWorkflowDraft } = useNodesSyncDraft()
const appId = useAppStore.getState().appDetail?.id
const {
checkNestedParallelLimit,
getAfterNodesInSameBranch,
@ -592,17 +590,6 @@ export const useNodesInteractions = () => {
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)

View File

@ -26,14 +26,6 @@ const nodeDefault: NodeDefault<WebhookTriggerNodeType> = {
return nodes.filter(type => type !== BlockEnum.Start)
},
checkValid(payload: WebhookTriggerNodeType, t: any) {
// Validate webhook configuration
if (!payload.webhook_url) {
return {
isValid: false,
errorMessage: t('workflow.nodes.triggerWebhook.validation.webhookUrlRequired'),
}
}
// Validate parameter types for params and body
const parametersWithTypes = [
...(payload.params || []),