Remove "loadOptionsMethod" for Airtable application selection

This commit is contained in:
Jan Oberhauser 2020-02-10 17:39:44 -08:00
parent e67afb9e92
commit 87f2e8b91c

View file

@ -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[] = [];