mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-18 02:21:13 +00:00
fix(core): Missing pairing info (#7326)
Github issue / Community forum post (link here to close automatically):
This commit is contained in:
@@ -61,9 +61,11 @@ describe('Test AirtableV2, base => getMany', () => {
|
||||
name: 'base 1',
|
||||
permissionLevel: 'create',
|
||||
},
|
||||
pairedItem: {
|
||||
item: 0,
|
||||
},
|
||||
pairedItem: [
|
||||
{
|
||||
item: 0,
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
json: {
|
||||
@@ -71,9 +73,11 @@ describe('Test AirtableV2, base => getMany', () => {
|
||||
name: 'base 2',
|
||||
permissionLevel: 'edit',
|
||||
},
|
||||
pairedItem: {
|
||||
item: 0,
|
||||
},
|
||||
pairedItem: [
|
||||
{
|
||||
item: 0,
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
json: {
|
||||
@@ -81,9 +85,11 @@ describe('Test AirtableV2, base => getMany', () => {
|
||||
name: 'base 3',
|
||||
permissionLevel: 'create',
|
||||
},
|
||||
pairedItem: {
|
||||
item: 0,
|
||||
},
|
||||
pairedItem: [
|
||||
{
|
||||
item: 0,
|
||||
},
|
||||
],
|
||||
},
|
||||
]);
|
||||
});
|
||||
@@ -107,9 +113,11 @@ describe('Test AirtableV2, base => getMany', () => {
|
||||
name: 'base 2',
|
||||
permissionLevel: 'edit',
|
||||
},
|
||||
pairedItem: {
|
||||
item: 0,
|
||||
},
|
||||
pairedItem: [
|
||||
{
|
||||
item: 0,
|
||||
},
|
||||
],
|
||||
},
|
||||
]);
|
||||
});
|
||||
|
||||
@@ -16,6 +16,9 @@ export const node: INode = {
|
||||
|
||||
export const createMockExecuteFunction = (nodeParameters: IDataObject) => {
|
||||
const fakeExecuteFunction = {
|
||||
getInputData() {
|
||||
return [{ json: {} }];
|
||||
},
|
||||
getNodeParameter(
|
||||
parameterName: string,
|
||||
_itemIndex: number,
|
||||
|
||||
@@ -110,9 +110,11 @@ describe('Test AirtableV2, search operation', () => {
|
||||
expect(result).toHaveLength(2);
|
||||
expect(result[0]).toEqual({
|
||||
json: { id: 'recYYY', foo: 'foo 2', bar: 'bar 2' },
|
||||
pairedItem: {
|
||||
item: 0,
|
||||
},
|
||||
pairedItem: [
|
||||
{
|
||||
item: 0,
|
||||
},
|
||||
],
|
||||
});
|
||||
});
|
||||
|
||||
@@ -152,9 +154,11 @@ describe('Test AirtableV2, search operation', () => {
|
||||
expect(result).toHaveLength(1);
|
||||
expect(result[0]).toEqual({
|
||||
json: { id: 'recYYY', foo: 'foo 2', bar: 'bar 2' },
|
||||
pairedItem: {
|
||||
item: 0,
|
||||
},
|
||||
pairedItem: [
|
||||
{
|
||||
item: 0,
|
||||
},
|
||||
],
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
@@ -13,6 +13,7 @@ import type { IRecord } from './GenericFunctions';
|
||||
import { apiRequest, apiRequestAllItems, downloadRecordAttachments } from './GenericFunctions';
|
||||
|
||||
import { oldVersionNotice } from '../../../utils/descriptions';
|
||||
import { generatePairedItemData } from '../../../utils/utilities';
|
||||
|
||||
const versionDescription: INodeTypeDescription = {
|
||||
displayName: 'Airtable',
|
||||
@@ -727,9 +728,11 @@ export class AirtableV1 implements INodeType {
|
||||
}
|
||||
|
||||
// We can return from here
|
||||
const itemData = generatePairedItemData(items.length);
|
||||
|
||||
return [
|
||||
this.helpers.constructExecutionMetaData(this.helpers.returnJsonArray(returnData), {
|
||||
itemData: { item: 0 },
|
||||
itemData,
|
||||
}),
|
||||
];
|
||||
} catch (error) {
|
||||
|
||||
@@ -4,7 +4,11 @@ import type {
|
||||
INodeProperties,
|
||||
IExecuteFunctions,
|
||||
} from 'n8n-workflow';
|
||||
import { updateDisplayOptions, wrapData } from '../../../../../utils/utilities';
|
||||
import {
|
||||
generatePairedItemData,
|
||||
updateDisplayOptions,
|
||||
wrapData,
|
||||
} from '../../../../../utils/utilities';
|
||||
import { apiRequest } from '../../transport';
|
||||
|
||||
const properties: INodeProperties[] = [
|
||||
@@ -107,8 +111,10 @@ export async function execute(this: IExecuteFunctions): Promise<INodeExecutionDa
|
||||
bases = bases.filter((base) => permissionLevel.includes(base.permissionLevel as string));
|
||||
}
|
||||
|
||||
const itemData = generatePairedItemData(this.getInputData().length);
|
||||
|
||||
const returnData = this.helpers.constructExecutionMetaData(wrapData(bases), {
|
||||
itemData: { item: 0 },
|
||||
itemData,
|
||||
});
|
||||
|
||||
return returnData;
|
||||
|
||||
@@ -4,7 +4,7 @@ import type {
|
||||
INodeProperties,
|
||||
IExecuteFunctions,
|
||||
} from 'n8n-workflow';
|
||||
import { updateDisplayOptions } from '../../../../../utils/utilities';
|
||||
import { generatePairedItemData, updateDisplayOptions } from '../../../../../utils/utilities';
|
||||
import { apiRequest, apiRequestAllItems, downloadRecordAttachments } from '../../transport';
|
||||
import type { IRecord } from '../../helpers/interfaces';
|
||||
import { flattenOutput } from '../../helpers/utils';
|
||||
@@ -205,8 +205,10 @@ export async function execute(
|
||||
json: flattenOutput(record as IDataObject),
|
||||
}));
|
||||
|
||||
const itemData = generatePairedItemData(items.length);
|
||||
|
||||
returnData = this.helpers.constructExecutionMetaData(returnData, {
|
||||
itemData: { item: 0 },
|
||||
itemData,
|
||||
});
|
||||
} catch (error) {
|
||||
if (this.continueOnFail()) {
|
||||
|
||||
Reference in New Issue
Block a user