mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 18:12:04 +00:00
🔃Add unction getCurrentNodeParameters to get currents parameters in loading function
This commit is contained in:
@@ -525,6 +525,7 @@ class App {
|
||||
this.app.get('/rest/node-parameter-options', ResponseHelper.send(async (req: express.Request, res: express.Response): Promise<INodePropertyOptions[]> => {
|
||||
const nodeType = req.query.nodeType;
|
||||
let credentials: INodeCredentials | undefined = undefined;
|
||||
const currentNodeParameters = req.query.currentNodeParameters;
|
||||
if (req.query.credentials !== undefined) {
|
||||
credentials = JSON.parse(req.query.credentials);
|
||||
}
|
||||
@@ -537,7 +538,7 @@ class App {
|
||||
|
||||
const workflowData = loadDataInstance.getWorkflowData() as IWorkflowBase;
|
||||
const workflowCredentials = await WorkflowCredentials(workflowData.nodes);
|
||||
const additionalData = await WorkflowExecuteAdditionalData.getBase(executionMode, workflowCredentials);
|
||||
const additionalData = await WorkflowExecuteAdditionalData.getBase(executionMode, workflowCredentials,currentNodeParameters);
|
||||
|
||||
return loadDataInstance.getOptions(methodName, additionalData);
|
||||
}));
|
||||
|
||||
@@ -23,6 +23,7 @@ import {
|
||||
IWorkflowExecuteAdditionalData,
|
||||
IWorkflowExecuteHooks,
|
||||
WorkflowExecuteMode,
|
||||
INodeParameters,
|
||||
} from 'n8n-workflow';
|
||||
|
||||
import * as config from '../config';
|
||||
@@ -245,7 +246,7 @@ const hooks = (mode: WorkflowExecuteMode, workflowData: IWorkflowBase, execution
|
||||
* @param {IWorkflowCredentials} credentials
|
||||
* @returns {Promise<IWorkflowExecuteAdditionalData>}
|
||||
*/
|
||||
export async function getBase(mode: WorkflowExecuteMode, credentials: IWorkflowCredentials): Promise<IWorkflowExecuteAdditionalData> {
|
||||
export async function getBase(mode: WorkflowExecuteMode, credentials: IWorkflowCredentials,currentNodeParameters: INodeParameters[] = []): Promise<IWorkflowExecuteAdditionalData> {
|
||||
const urlBaseWebhook = WebhookHelpers.getWebhookBaseUrl();
|
||||
|
||||
const timezone = config.get('generic.timezone') as string;
|
||||
@@ -263,6 +264,7 @@ export async function getBase(mode: WorkflowExecuteMode, credentials: IWorkflowC
|
||||
timezone,
|
||||
webhookBaseUrl,
|
||||
webhookTestBaseUrl,
|
||||
currentNodeParameters
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user