mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 10:02:05 +00:00
fix(Wait Node): Fix for hasNextPage in waiting forms (#12636)
This commit is contained in:
@@ -326,6 +326,13 @@ export function renderForm({
|
||||
res.render('form-trigger', data);
|
||||
}
|
||||
|
||||
export const isFormConnected = (nodes: NodeTypeAndVersion[]) => {
|
||||
return nodes.some(
|
||||
(n) =>
|
||||
n.type === FORM_NODE_TYPE || (n.type === WAIT_NODE_TYPE && n.parameters?.resume === 'form'),
|
||||
);
|
||||
};
|
||||
|
||||
export async function formWebhook(
|
||||
context: IWebhookFunctions,
|
||||
authProperty = FORM_TRIGGER_AUTHENTICATION_PROPERTY,
|
||||
@@ -403,10 +410,10 @@ export async function formWebhook(
|
||||
}
|
||||
|
||||
if (!redirectUrl && node.type !== FORM_TRIGGER_NODE_TYPE) {
|
||||
const connectedNodes = context.getChildNodes(context.getNode().name);
|
||||
const hasNextPage = connectedNodes.some(
|
||||
(n) => n.type === FORM_NODE_TYPE || n.type === WAIT_NODE_TYPE,
|
||||
);
|
||||
const connectedNodes = context.getChildNodes(context.getNode().name, {
|
||||
includeNodeParameters: true,
|
||||
});
|
||||
const hasNextPage = isFormConnected(connectedNodes);
|
||||
|
||||
if (hasNextPage) {
|
||||
redirectUrl = context.evaluateExpression('{{ $execution.resumeFormUrl }}') as string;
|
||||
|
||||
Reference in New Issue
Block a user