mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 18:12:04 +00:00
feat(Webhook Node): Setting to enable multiple outputs/methods (#9086)
Co-authored-by: Giulio Andreini <andreini@netseven.it>
This commit is contained in:
@@ -996,7 +996,7 @@ export function getNodeWebhooks(
|
||||
) as boolean;
|
||||
const path = getNodeWebhookPath(workflowId, node, nodeWebhookPath, isFullPath, restartWebhook);
|
||||
|
||||
const httpMethod = workflow.expression.getSimpleParameterValue(
|
||||
const webhookMethods = workflow.expression.getSimpleParameterValue(
|
||||
node,
|
||||
webhookDescription.httpMethod,
|
||||
mode,
|
||||
@@ -1005,7 +1005,7 @@ export function getNodeWebhooks(
|
||||
'GET',
|
||||
);
|
||||
|
||||
if (httpMethod === undefined) {
|
||||
if (webhookMethods === undefined) {
|
||||
// TODO: Use a proper logger
|
||||
console.error(
|
||||
`The webhook "${path}" for node "${node.name}" in workflow "${workflowId}" could not be added because the httpMethod is not defined.`,
|
||||
@@ -1018,15 +1018,20 @@ export function getNodeWebhooks(
|
||||
webhookId = node.webhookId;
|
||||
}
|
||||
|
||||
returnData.push({
|
||||
httpMethod: httpMethod.toString() as IHttpRequestMethods,
|
||||
node: node.name,
|
||||
path,
|
||||
webhookDescription,
|
||||
workflowId,
|
||||
workflowExecuteAdditionalData: additionalData,
|
||||
webhookId,
|
||||
});
|
||||
String(webhookMethods)
|
||||
.split(',')
|
||||
.forEach((httpMethod) => {
|
||||
if (!httpMethod) return;
|
||||
returnData.push({
|
||||
httpMethod: httpMethod.trim() as IHttpRequestMethods,
|
||||
node: node.name,
|
||||
path,
|
||||
webhookDescription,
|
||||
workflowId,
|
||||
workflowExecuteAdditionalData: additionalData,
|
||||
webhookId,
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
return returnData;
|
||||
|
||||
Reference in New Issue
Block a user