mirror of
https://github.com/n8n-io/n8n.git
synced 2025-03-05 20:50:17 -08:00
🔥 Remove unused filters
This commit is contained in:
parent
a885518019
commit
15b8db75d8
|
@ -192,14 +192,7 @@ export class ZohoCrm implements INodeType {
|
||||||
// account: getAll
|
// account: getAll
|
||||||
// ----------------------------------------
|
// ----------------------------------------
|
||||||
|
|
||||||
const body: IDataObject = {};
|
responseData = await handleListing.call(this, 'GET', '/accounts');
|
||||||
const filters = this.getNodeParameter('filters', i) as IDataObject;
|
|
||||||
|
|
||||||
if (Object.keys(filters).length) {
|
|
||||||
Object.assign(body, filters);
|
|
||||||
}
|
|
||||||
|
|
||||||
responseData = await handleListing.call(this, 'GET', '/accounts', body);
|
|
||||||
|
|
||||||
} else if (operation === 'update') {
|
} else if (operation === 'update') {
|
||||||
|
|
||||||
|
@ -275,14 +268,7 @@ export class ZohoCrm implements INodeType {
|
||||||
// contact: getAll
|
// contact: getAll
|
||||||
// ----------------------------------------
|
// ----------------------------------------
|
||||||
|
|
||||||
const body: IDataObject = {};
|
responseData = await handleListing.call(this, 'GET', '/contacts');
|
||||||
const filters = this.getNodeParameter('filters', i) as IDataObject;
|
|
||||||
|
|
||||||
if (Object.keys(filters).length) {
|
|
||||||
Object.assign(body, filters);
|
|
||||||
}
|
|
||||||
|
|
||||||
responseData = await handleListing.call(this, 'GET', '/contacts', body);
|
|
||||||
|
|
||||||
} else if (operation === 'update') {
|
} else if (operation === 'update') {
|
||||||
|
|
||||||
|
@ -357,14 +343,7 @@ export class ZohoCrm implements INodeType {
|
||||||
// deal: getAll
|
// deal: getAll
|
||||||
// ----------------------------------------
|
// ----------------------------------------
|
||||||
|
|
||||||
const body: IDataObject = {};
|
responseData = await handleListing.call(this, 'GET', '/deals');
|
||||||
const filters = this.getNodeParameter('filters', i) as IDataObject;
|
|
||||||
|
|
||||||
if (Object.keys(filters).length) {
|
|
||||||
Object.assign(body, filters);
|
|
||||||
}
|
|
||||||
|
|
||||||
responseData = await handleListing.call(this, 'GET', '/deals', body);
|
|
||||||
|
|
||||||
} else if (operation === 'update') {
|
} else if (operation === 'update') {
|
||||||
|
|
||||||
|
@ -440,14 +419,7 @@ export class ZohoCrm implements INodeType {
|
||||||
// invoice: getAll
|
// invoice: getAll
|
||||||
// ----------------------------------------
|
// ----------------------------------------
|
||||||
|
|
||||||
const body: IDataObject = {};
|
responseData = await handleListing.call(this, 'GET', '/invoices');
|
||||||
const filters = this.getNodeParameter('filters', i) as IDataObject;
|
|
||||||
|
|
||||||
if (Object.keys(filters).length) {
|
|
||||||
Object.assign(body, filters);
|
|
||||||
}
|
|
||||||
|
|
||||||
responseData = await handleListing.call(this, 'GET', '/invoices', body);
|
|
||||||
|
|
||||||
} else if (operation === 'update') {
|
} else if (operation === 'update') {
|
||||||
|
|
||||||
|
@ -522,14 +494,7 @@ export class ZohoCrm implements INodeType {
|
||||||
// lead: getAll
|
// lead: getAll
|
||||||
// ----------------------------------------
|
// ----------------------------------------
|
||||||
|
|
||||||
const body: IDataObject = {};
|
responseData = await handleListing.call(this, 'GET', '/leads');
|
||||||
const filters = this.getNodeParameter('filters', i) as IDataObject;
|
|
||||||
|
|
||||||
if (Object.keys(filters).length) {
|
|
||||||
Object.assign(body, filters);
|
|
||||||
}
|
|
||||||
|
|
||||||
responseData = await handleListing.call(this, 'GET', '/leads', body);
|
|
||||||
|
|
||||||
} else if (operation === 'update') {
|
} else if (operation === 'update') {
|
||||||
|
|
||||||
|
@ -605,14 +570,7 @@ export class ZohoCrm implements INodeType {
|
||||||
// purchaseOrder: getAll
|
// purchaseOrder: getAll
|
||||||
// ----------------------------------------
|
// ----------------------------------------
|
||||||
|
|
||||||
const body: IDataObject = {};
|
responseData = await handleListing.call(this, 'GET', '/purchaseorders');
|
||||||
const filters = this.getNodeParameter('filters', i) as IDataObject;
|
|
||||||
|
|
||||||
if (Object.keys(filters).length) {
|
|
||||||
Object.assign(body, filters);
|
|
||||||
}
|
|
||||||
|
|
||||||
responseData = await handleListing.call(this, 'GET', '/purchaseorders', body);
|
|
||||||
|
|
||||||
} else if (operation === 'update') {
|
} else if (operation === 'update') {
|
||||||
|
|
||||||
|
@ -687,14 +645,7 @@ export class ZohoCrm implements INodeType {
|
||||||
// quote: getAll
|
// quote: getAll
|
||||||
// ----------------------------------------
|
// ----------------------------------------
|
||||||
|
|
||||||
const body: IDataObject = {};
|
responseData = await handleListing.call(this, 'GET', '/quotes');
|
||||||
const filters = this.getNodeParameter('filters', i) as IDataObject;
|
|
||||||
|
|
||||||
if (Object.keys(filters).length) {
|
|
||||||
Object.assign(body, filters);
|
|
||||||
}
|
|
||||||
|
|
||||||
responseData = await handleListing.call(this, 'GET', '/quotes', body);
|
|
||||||
|
|
||||||
} else if (operation === 'update') {
|
} else if (operation === 'update') {
|
||||||
|
|
||||||
|
@ -770,14 +721,7 @@ export class ZohoCrm implements INodeType {
|
||||||
// salesOrder: getAll
|
// salesOrder: getAll
|
||||||
// ----------------------------------------
|
// ----------------------------------------
|
||||||
|
|
||||||
const body: IDataObject = {};
|
responseData = await handleListing.call(this, 'GET', '/salesorders');
|
||||||
const filters = this.getNodeParameter('filters', i) as IDataObject;
|
|
||||||
|
|
||||||
if (Object.keys(filters).length) {
|
|
||||||
Object.assign(body, filters);
|
|
||||||
}
|
|
||||||
|
|
||||||
responseData = await handleListing.call(this, 'GET', '/salesorders', body);
|
|
||||||
|
|
||||||
} else if (operation === 'update') {
|
} else if (operation === 'update') {
|
||||||
|
|
||||||
|
|
|
@ -304,12 +304,6 @@ export const productDetails = {
|
||||||
],
|
],
|
||||||
};
|
};
|
||||||
|
|
||||||
const pluralize = (resource: string) => (isCamelCase(resource) ? splitCamelCased(resource) : resource) + 's';
|
|
||||||
|
|
||||||
const isCamelCase = (resource: string) => /([a-z])([A-Z])/.test(resource);
|
|
||||||
|
|
||||||
const splitCamelCased = (resource: string) => resource.replace(/([a-z])([A-Z])/, '$1 $2').toLowerCase();
|
|
||||||
|
|
||||||
export const makeGetAllFields = (resource: string) => [
|
export const makeGetAllFields = (resource: string) => [
|
||||||
{
|
{
|
||||||
displayName: 'Return All',
|
displayName: 'Return All',
|
||||||
|
@ -352,30 +346,4 @@ export const makeGetAllFields = (resource: string) => [
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
|
||||||
displayName: 'Filters',
|
|
||||||
name: 'filters',
|
|
||||||
type: 'collection',
|
|
||||||
placeholder: 'Add Filter',
|
|
||||||
default: {},
|
|
||||||
displayOptions: {
|
|
||||||
show: {
|
|
||||||
resource: [
|
|
||||||
resource,
|
|
||||||
],
|
|
||||||
operation: [
|
|
||||||
'getAll',
|
|
||||||
],
|
|
||||||
},
|
|
||||||
},
|
|
||||||
options: [
|
|
||||||
{
|
|
||||||
displayName: 'IDs',
|
|
||||||
name: 'id',
|
|
||||||
type: 'string',
|
|
||||||
default: '',
|
|
||||||
description: `Comma-separated list of IDs to filter the ${pluralize(resource)} by.`,
|
|
||||||
},
|
|
||||||
],
|
|
||||||
},
|
|
||||||
];
|
];
|
||||||
|
|
Loading…
Reference in a new issue