mirror of
https://github.com/n8n-io/n8n.git
synced 2024-11-10 06:34:05 -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
|
||||
// ----------------------------------
|
||||
{
|
||||
displayName: 'Application',
|
||||
displayName: 'Application ID',
|
||||
name: 'application',
|
||||
type: 'options',
|
||||
typeOptions: {
|
||||
loadOptionsMethod: 'getApplications',
|
||||
},
|
||||
options: [],
|
||||
type: 'string',
|
||||
default: '',
|
||||
required: true,
|
||||
description: 'The application to access',
|
||||
description: 'The ID of the application to access.',
|
||||
},
|
||||
{
|
||||
displayName: 'Table',
|
||||
|
@ -93,7 +89,7 @@ export class Airtable implements INodeType {
|
|||
default: '',
|
||||
placeholder: 'Stories',
|
||||
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[][]> {
|
||||
const items = this.getInputData();
|
||||
const returnData: IDataObject[] = [];
|
||||
|
|
Loading…
Reference in a new issue