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:
Omar Ajoue 2022-01-21 10:32:16 +01:00 committed by GitHub
parent a41afc8013
commit 2e57d86fd6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 6 deletions

View file

@ -26,9 +26,6 @@ export class MattermostV1 implements INodeType {
methods = { loadOptions };
async execute(this: IExecuteFunctions) {
// Router returns INodeExecutionData[]
// We need to output INodeExecutionData[][]
// So we wrap in []
return [await router.call(this)];
return await router.call(this);
}
}

View file

@ -12,7 +12,7 @@ import * as reaction from './reaction';
import * as user from './user';
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 operationResult: INodeExecutionData[] = [];
@ -49,5 +49,5 @@ export async function router(this: IExecuteFunctions): Promise<INodeExecutionDat
}
}
return operationResult;
return [operationResult];
}