feat(Webhook Node): Setting to enable multiple outputs/methods (#9086)

Co-authored-by: Giulio Andreini <andreini@netseven.it>
This commit is contained in:
Michael Kret
2024-04-24 08:46:16 +03:00
committed by GitHub
parent f6142ff275
commit 2bf0a3933e
7 changed files with 153 additions and 29 deletions

View File

@@ -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;