mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 18:12:04 +00:00
refactor: Improve typings for webhook methods (no-changelog) (#5713)
This commit is contained in:
committed by
GitHub
parent
a28396ee91
commit
6a8c9b7ccc
@@ -982,17 +982,8 @@ export class Workflow {
|
||||
const node = this.getNode(webhookData.node) as INode;
|
||||
const nodeType = this.nodeTypes.getByNameAndVersion(node.type, node.typeVersion);
|
||||
|
||||
if (nodeType.webhookMethods === undefined) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (nodeType.webhookMethods[webhookData.webhookDescription.name] === undefined) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (nodeType.webhookMethods[webhookData.webhookDescription.name][method] === undefined) {
|
||||
return;
|
||||
}
|
||||
const webhookFn = nodeType.webhookMethods?.[webhookData.webhookDescription.name]?.[method];
|
||||
if (webhookFn === undefined) return;
|
||||
|
||||
const thisArgs = nodeExecuteFunctions.getExecuteHookFunctions(
|
||||
this,
|
||||
@@ -1003,8 +994,8 @@ export class Workflow {
|
||||
isTest,
|
||||
webhookData,
|
||||
);
|
||||
// eslint-disable-next-line consistent-return
|
||||
return nodeType.webhookMethods[webhookData.webhookDescription.name][method]!.call(thisArgs);
|
||||
|
||||
return webhookFn.call(thisArgs);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user