mirror of
https://github.com/n8n-io/n8n.git
synced 2025-03-05 20:50:17 -08:00
replace location only on waiting forms
This commit is contained in:
parent
293128230b
commit
75ab8988d9
|
@ -1,7 +1,12 @@
|
|||
import { Service } from '@n8n/di';
|
||||
import type express from 'express';
|
||||
import type { IRunData } from 'n8n-workflow';
|
||||
import { FORM_NODE_TYPE, WAITING_FORMS_EXECUTION_STATUS, Workflow } from 'n8n-workflow';
|
||||
import {
|
||||
FORM_NODE_TYPE,
|
||||
WAIT_NODE_TYPE,
|
||||
WAITING_FORMS_EXECUTION_STATUS,
|
||||
Workflow,
|
||||
} from 'n8n-workflow';
|
||||
|
||||
import { ConflictError } from '@/errors/response-errors/conflict.error';
|
||||
import { NotFoundError } from '@/errors/response-errors/not-found.error';
|
||||
|
@ -74,8 +79,19 @@ export class WaitingForms extends WaitingWebhooks {
|
|||
|
||||
const execution = await this.getExecution(executionId);
|
||||
|
||||
if (suffix === WAITING_FORMS_EXECUTION_STATUS) {
|
||||
res.send(execution?.status ?? null);
|
||||
if (execution && suffix === WAITING_FORMS_EXECUTION_STATUS) {
|
||||
let status: string = execution?.status;
|
||||
const { node } = execution.data.executionData?.nodeExecutionStack[0] ?? {};
|
||||
|
||||
if (node && status === 'waiting') {
|
||||
if (node.type === FORM_NODE_TYPE) {
|
||||
status = 'form-waiting';
|
||||
}
|
||||
if (node.type === WAIT_NODE_TYPE && node.parameters.resume === 'form') {
|
||||
status = 'form-waiting';
|
||||
}
|
||||
}
|
||||
res.send(status ?? null);
|
||||
return { noWebhookResponse: true };
|
||||
}
|
||||
|
||||
|
|
|
@ -779,7 +779,7 @@
|
|||
const response = await fetch(`${formWaitingUrl ?? window.location.href}/n8n-execution-status`);
|
||||
const text = (await response.text()).trim();
|
||||
|
||||
if (text === "waiting") {
|
||||
if (text === "form-waiting") {
|
||||
window.location.replace(formWaitingUrl ?? window.location.href);
|
||||
return;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue