mirror of
https://github.com/n8n-io/n8n.git
synced 2024-11-12 15:44:06 -08:00
⚡ Change the place where output format is made (#2506)
The router file now correctly returns a `INodeExecutionData[][]` instead of a simple `INodeExecutionData[]` forcing the main node file to correct this.
This commit is contained in:
parent
a41afc8013
commit
2e57d86fd6
|
@ -26,9 +26,6 @@ export class MattermostV1 implements INodeType {
|
||||||
methods = { loadOptions };
|
methods = { loadOptions };
|
||||||
|
|
||||||
async execute(this: IExecuteFunctions) {
|
async execute(this: IExecuteFunctions) {
|
||||||
// Router returns INodeExecutionData[]
|
return await router.call(this);
|
||||||
// We need to output INodeExecutionData[][]
|
|
||||||
// So we wrap in []
|
|
||||||
return [await router.call(this)];
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -12,7 +12,7 @@ import * as reaction from './reaction';
|
||||||
import * as user from './user';
|
import * as user from './user';
|
||||||
import { Mattermost } from './Interfaces';
|
import { Mattermost } from './Interfaces';
|
||||||
|
|
||||||
export async function router(this: IExecuteFunctions): Promise<INodeExecutionData[]> {
|
export async function router(this: IExecuteFunctions): Promise<INodeExecutionData[][]> {
|
||||||
const items = this.getInputData();
|
const items = this.getInputData();
|
||||||
const operationResult: INodeExecutionData[] = [];
|
const operationResult: INodeExecutionData[] = [];
|
||||||
|
|
||||||
|
@ -49,5 +49,5 @@ export async function router(this: IExecuteFunctions): Promise<INodeExecutionDat
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return operationResult;
|
return [operationResult];
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue