mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-20 11:22:15 +00:00
fix(n8n Form Trigger Node): Update error in validateResponseModeConfiguration (no-changelog) (#13162)
This commit is contained in:
@@ -187,9 +187,10 @@ export function prepareFormData({
|
||||
return formData;
|
||||
}
|
||||
|
||||
const validateResponseModeConfiguration = (context: IWebhookFunctions) => {
|
||||
export const validateResponseModeConfiguration = (context: IWebhookFunctions) => {
|
||||
const responseMode = context.getNodeParameter('responseMode', 'onReceived') as string;
|
||||
const connectedNodes = context.getChildNodes(context.getNode().name);
|
||||
const nodeVersion = context.getNode().typeVersion;
|
||||
|
||||
const isRespondToWebhookConnected = connectedNodes.some(
|
||||
(node) => node.type === 'n8n-nodes-base.respondToWebhook',
|
||||
@@ -206,7 +207,7 @@ const validateResponseModeConfiguration = (context: IWebhookFunctions) => {
|
||||
);
|
||||
}
|
||||
|
||||
if (isRespondToWebhookConnected && responseMode !== 'responseNode') {
|
||||
if (isRespondToWebhookConnected && responseMode !== 'responseNode' && nodeVersion <= 2.1) {
|
||||
throw new NodeOperationError(
|
||||
context.getNode(),
|
||||
new Error(`${context.getNode().name} node not correctly configured`),
|
||||
@@ -216,6 +217,19 @@ const validateResponseModeConfiguration = (context: IWebhookFunctions) => {
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
if (isRespondToWebhookConnected && nodeVersion > 2.1) {
|
||||
throw new NodeOperationError(
|
||||
context.getNode(),
|
||||
new Error(
|
||||
'The "Respond to Webhook" node is not supported in workflows initiated by the "n8n Form Trigger"',
|
||||
),
|
||||
{
|
||||
description:
|
||||
'To configure your response, add an "n8n Form" node and set the "Page Type" to "Form Ending"',
|
||||
},
|
||||
);
|
||||
}
|
||||
};
|
||||
|
||||
export async function prepareFormReturnItem(
|
||||
|
||||
Reference in New Issue
Block a user