fix(Wait Node): Fix for hasNextPage in waiting forms (#12636)

This commit is contained in:
Michael Kret
2025-01-20 11:41:50 +02:00
committed by GitHub
parent 847aa1295d
commit 652b8d170b
4 changed files with 66 additions and 9 deletions

View File

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