Rename webhookPath parameter on node to webhookId

This commit is contained in:
Jan Oberhauser 2020-06-10 16:17:16 +02:00
parent 17ee152eaf
commit cee5c522de
3 changed files with 5 additions and 5 deletions

View file

@ -949,7 +949,7 @@ export default mixins(
newNodeData.name = this.getUniqueNodeName(newNodeData.name);
if (nodeTypeData.webhooks && nodeTypeData.webhooks.length) {
newNodeData.webhookPath = uuidv4();
newNodeData.webhookId = uuidv4();
}
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 (node.type === 'n8n-nodes-base.webhook' && node.parameters.path === '') {
node.parameters.path = node.webhookPath as string;
node.parameters.path = node.webhookId as string;
}
}

View file

@ -297,7 +297,7 @@ export interface INode {
continueOnFail?: boolean;
parameters: INodeParameters;
credentials?: INodeCredentials;
webhookPath?: string;
webhookId?: string;
}

View file

@ -859,13 +859,13 @@ export function getNodeWebhooksBasic(workflow: Workflow, node: INode): IWebhookD
*/
export function getNodeWebhookPath(workflowId: string, node: INode, path: string, isFullPath?: boolean): string {
let webhookPath = '';
if (node.webhookPath === undefined) {
if (node.webhookId === undefined) {
webhookPath = `${workflowId}/${encodeURIComponent(node.name.toLowerCase())}/${path}`;
} else {
if (isFullPath === true) {
return path;
}
webhookPath = `${node.webhookPath}/${path}`;
webhookPath = `${node.webhookId}/${path}`;
}
return webhookPath;
}