mirror of
https://github.com/n8n-io/n8n.git
synced 2025-02-02 07:01:30 -08:00
⚡ Remove "loadOptionsMethod" for Airtable application selection
This commit is contained in:
parent
e67afb9e92
commit
87f2e8b91c
|
@ -75,16 +75,12 @@ export class Airtable implements INodeType {
|
||||||
// All
|
// All
|
||||||
// ----------------------------------
|
// ----------------------------------
|
||||||
{
|
{
|
||||||
displayName: 'Application',
|
displayName: 'Application ID',
|
||||||
name: 'application',
|
name: 'application',
|
||||||
type: 'options',
|
type: 'string',
|
||||||
typeOptions: {
|
|
||||||
loadOptionsMethod: 'getApplications',
|
|
||||||
},
|
|
||||||
options: [],
|
|
||||||
default: '',
|
default: '',
|
||||||
required: true,
|
required: true,
|
||||||
description: 'The application to access',
|
description: 'The ID of the application to access.',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
displayName: 'Table',
|
displayName: 'Table',
|
||||||
|
@ -93,7 +89,7 @@ export class Airtable implements INodeType {
|
||||||
default: '',
|
default: '',
|
||||||
placeholder: 'Stories',
|
placeholder: 'Stories',
|
||||||
required: true,
|
required: true,
|
||||||
description: 'The name of table to access',
|
description: 'The name of table to access.',
|
||||||
},
|
},
|
||||||
|
|
||||||
// ----------------------------------
|
// ----------------------------------
|
||||||
|
@ -363,32 +359,6 @@ export class Airtable implements INodeType {
|
||||||
],
|
],
|
||||||
};
|
};
|
||||||
|
|
||||||
methods = {
|
|
||||||
loadOptions: {
|
|
||||||
// Get all the available applications to display them to user so that he can
|
|
||||||
// select them easily
|
|
||||||
async getApplications(this: ILoadOptionsFunctions): Promise<INodePropertyOptions[]> {
|
|
||||||
const endpoint = 'meta';
|
|
||||||
const responseData = await apiRequest.call(this, 'GET', endpoint, {});
|
|
||||||
|
|
||||||
if (responseData.applications === undefined) {
|
|
||||||
throw new Error('No data got returned');
|
|
||||||
}
|
|
||||||
|
|
||||||
const returnData: INodePropertyOptions[] = [];
|
|
||||||
for (const baseData of responseData.applications) {
|
|
||||||
returnData.push({
|
|
||||||
name: baseData.name,
|
|
||||||
value: baseData.id,
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
return returnData;
|
|
||||||
},
|
|
||||||
},
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
async execute(this: IExecuteFunctions): Promise<INodeExecutionData[][]> {
|
async execute(this: IExecuteFunctions): Promise<INodeExecutionData[][]> {
|
||||||
const items = this.getInputData();
|
const items = this.getInputData();
|
||||||
const returnData: IDataObject[] = [];
|
const returnData: IDataObject[] = [];
|
||||||
|
|
Loading…
Reference in a new issue