mirror of
https://github.com/n8n-io/n8n.git
synced 2024-12-26 05:04:05 -08:00
⚡ Rename webhookPath parameter on node to webhookId
This commit is contained in:
parent
17ee152eaf
commit
cee5c522de
|
@ -949,7 +949,7 @@ export default mixins(
|
||||||
newNodeData.name = this.getUniqueNodeName(newNodeData.name);
|
newNodeData.name = this.getUniqueNodeName(newNodeData.name);
|
||||||
|
|
||||||
if (nodeTypeData.webhooks && nodeTypeData.webhooks.length) {
|
if (nodeTypeData.webhooks && nodeTypeData.webhooks.length) {
|
||||||
newNodeData.webhookPath = uuidv4();
|
newNodeData.webhookId = uuidv4();
|
||||||
}
|
}
|
||||||
|
|
||||||
await this.addNodes([newNodeData]);
|
await this.addNodes([newNodeData]);
|
||||||
|
@ -1588,7 +1588,7 @@ export default mixins(
|
||||||
|
|
||||||
// if it's a webhook and the path is empty set the UUID as the default path
|
// if it's a webhook and the path is empty set the UUID as the default path
|
||||||
if (node.type === 'n8n-nodes-base.webhook' && node.parameters.path === '') {
|
if (node.type === 'n8n-nodes-base.webhook' && node.parameters.path === '') {
|
||||||
node.parameters.path = node.webhookPath as string;
|
node.parameters.path = node.webhookId as string;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -297,7 +297,7 @@ export interface INode {
|
||||||
continueOnFail?: boolean;
|
continueOnFail?: boolean;
|
||||||
parameters: INodeParameters;
|
parameters: INodeParameters;
|
||||||
credentials?: INodeCredentials;
|
credentials?: INodeCredentials;
|
||||||
webhookPath?: string;
|
webhookId?: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -859,13 +859,13 @@ export function getNodeWebhooksBasic(workflow: Workflow, node: INode): IWebhookD
|
||||||
*/
|
*/
|
||||||
export function getNodeWebhookPath(workflowId: string, node: INode, path: string, isFullPath?: boolean): string {
|
export function getNodeWebhookPath(workflowId: string, node: INode, path: string, isFullPath?: boolean): string {
|
||||||
let webhookPath = '';
|
let webhookPath = '';
|
||||||
if (node.webhookPath === undefined) {
|
if (node.webhookId === undefined) {
|
||||||
webhookPath = `${workflowId}/${encodeURIComponent(node.name.toLowerCase())}/${path}`;
|
webhookPath = `${workflowId}/${encodeURIComponent(node.name.toLowerCase())}/${path}`;
|
||||||
} else {
|
} else {
|
||||||
if (isFullPath === true) {
|
if (isFullPath === true) {
|
||||||
return path;
|
return path;
|
||||||
}
|
}
|
||||||
webhookPath = `${node.webhookPath}/${path}`;
|
webhookPath = `${node.webhookId}/${path}`;
|
||||||
}
|
}
|
||||||
return webhookPath;
|
return webhookPath;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue