mirror of
https://github.com/n8n-io/n8n.git
synced 2025-01-11 12:57:29 -08:00
adds first comments
This commit is contained in:
parent
124ac26e43
commit
dbcb5daf60
|
@ -345,6 +345,7 @@ export class Summarize implements INodeType {
|
|||
return [[executionData]];
|
||||
} else {
|
||||
if (!fieldsToSplitBy.length) {
|
||||
// [ria] if no fields to split by
|
||||
const { pairedItems, ...json } = aggregationResult;
|
||||
const executionData: INodeExecutionData = {
|
||||
json,
|
||||
|
@ -354,7 +355,7 @@ export class Summarize implements INodeType {
|
|||
};
|
||||
return [[executionData]];
|
||||
}
|
||||
const returnData = aggregationToArray(aggregationResult, fieldsToSplitBy);
|
||||
const returnData = aggregationToArray(aggregationResult, fieldsToSplitBy); // [ria] change here !!
|
||||
const executionData = returnData.map((item) => {
|
||||
const { pairedItems, ...json } = item;
|
||||
return {
|
||||
|
|
|
@ -231,7 +231,7 @@ export function splitData(
|
|||
const [firstSplitKey, ...restSplitKeys] = splitKeys;
|
||||
|
||||
const groupedData = data.reduce((acc, item) => {
|
||||
let keyValuee = getValue(item, firstSplitKey) as string;
|
||||
let keyValuee = getValue(item, firstSplitKey) as string; // [ria] is still a number
|
||||
|
||||
if (typeof keyValuee === 'object') {
|
||||
keyValuee = JSON.stringify(keyValuee);
|
||||
|
@ -240,9 +240,9 @@ export function splitData(
|
|||
if (options.skipEmptySplitFields && typeof keyValuee !== 'number' && !keyValuee) {
|
||||
return acc;
|
||||
}
|
||||
|
||||
// [ria] keyValuee is still number at this point
|
||||
if (acc[keyValuee] === undefined) {
|
||||
acc[keyValuee] = [item];
|
||||
acc[keyValuee] = [item]; // [ria] becomes string here
|
||||
} else {
|
||||
(acc[keyValuee] as IDataObject[]).push(item);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue