mirror of
https://github.com/n8n-io/n8n.git
synced 2025-03-05 20:50:17 -08:00
fix(editor): Use workflowHelpers.getWebhookUrl
to determine webhook/form test URL (no-changelog) (#9977)
This commit is contained in:
parent
df783151b8
commit
058ae5d3f6
|
@ -15,7 +15,7 @@ import type {
|
||||||
StartNodeData,
|
StartNodeData,
|
||||||
IRun,
|
IRun,
|
||||||
} from 'n8n-workflow';
|
} from 'n8n-workflow';
|
||||||
import { NodeConnectionType, FORM_TRIGGER_PATH_IDENTIFIER } from 'n8n-workflow';
|
import { NodeConnectionType } from 'n8n-workflow';
|
||||||
|
|
||||||
import { useToast } from '@/composables/useToast';
|
import { useToast } from '@/composables/useToast';
|
||||||
import { useNodeHelpers } from '@/composables/useNodeHelpers';
|
import { useNodeHelpers } from '@/composables/useNodeHelpers';
|
||||||
|
@ -29,6 +29,7 @@ import {
|
||||||
import { useTitleChange } from '@/composables/useTitleChange';
|
import { useTitleChange } from '@/composables/useTitleChange';
|
||||||
import { useRootStore } from '@/stores/root.store';
|
import { useRootStore } from '@/stores/root.store';
|
||||||
import { useUIStore } from '@/stores/ui.store';
|
import { useUIStore } from '@/stores/ui.store';
|
||||||
|
import { useNodeTypesStore } from '@/stores/nodeTypes.store';
|
||||||
import { useWorkflowsStore } from '@/stores/workflows.store';
|
import { useWorkflowsStore } from '@/stores/workflows.store';
|
||||||
import { openPopUpWindow } from '@/utils/executionUtils';
|
import { openPopUpWindow } from '@/utils/executionUtils';
|
||||||
import { useExternalHooks } from '@/composables/useExternalHooks';
|
import { useExternalHooks } from '@/composables/useExternalHooks';
|
||||||
|
@ -48,6 +49,7 @@ export function useRunWorkflow(useRunWorkflowOpts: { router: ReturnType<typeof u
|
||||||
|
|
||||||
const rootStore = useRootStore();
|
const rootStore = useRootStore();
|
||||||
const uiStore = useUIStore();
|
const uiStore = useUIStore();
|
||||||
|
const nodeTypesStore = useNodeTypesStore();
|
||||||
const workflowsStore = useWorkflowsStore();
|
const workflowsStore = useWorkflowsStore();
|
||||||
const executionsStore = useExecutionsStore();
|
const executionsStore = useExecutionsStore();
|
||||||
|
|
||||||
|
@ -277,14 +279,9 @@ export function useRunWorkflow(useRunWorkflowOpts: { router: ReturnType<typeof u
|
||||||
if (node.name === options.destinationNode || !node.disabled) {
|
if (node.name === options.destinationNode || !node.disabled) {
|
||||||
let testUrl = '';
|
let testUrl = '';
|
||||||
|
|
||||||
if (node.type === FORM_TRIGGER_NODE_TYPE && node.typeVersion === 1) {
|
const nodeType = nodeTypesStore.getNodeType(node.type, node.typeVersion);
|
||||||
const webhookPath = (node.parameters.path as string) || node.webhookId;
|
if (nodeType?.webhooks?.length) {
|
||||||
testUrl = `${rootStore.webhookTestUrl}/${webhookPath}/${FORM_TRIGGER_PATH_IDENTIFIER}`;
|
testUrl = workflowHelpers.getWebhookUrl(nodeType.webhooks[0], node, 'test');
|
||||||
}
|
|
||||||
|
|
||||||
if (node.type === FORM_TRIGGER_NODE_TYPE && node.typeVersion > 1) {
|
|
||||||
const webhookPath = (node.parameters.path as string) || node.webhookId;
|
|
||||||
testUrl = `${rootStore.formTestUrl}/${webhookPath}`;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (
|
if (
|
||||||
|
|
Loading…
Reference in a new issue