Rename operations

This commit is contained in:
Jan Oberhauser
2019-12-07 22:21:04 +01:00
parent 975856a772
commit ee4c46dbd3
2 changed files with 13 additions and 13 deletions

View File

@@ -39,13 +39,13 @@ export const dealOperations = [
description: 'Delete a deals', description: 'Delete a deals',
}, },
{ {
name: 'Recents Created', name: 'Get Recently Created',
value: 'getRecentsCreated', value: 'getRecentlyCreated',
description: 'Get recently created deals', description: 'Get recently created deals',
}, },
{ {
name: 'Recents Modified', name: 'Get Recently Modified',
value: 'getRecentsModified', value: 'getRecentlyModified',
description: 'Get recently modified deals', description: 'Get recently modified deals',
}, },
], ],
@@ -406,7 +406,7 @@ export const dealFields = [
description: 'Unique identifier for a particular deal', description: 'Unique identifier for a particular deal',
}, },
/* -------------------------------------------------------------------------- */ /* -------------------------------------------------------------------------- */
/* deal:getRecentsCreated deal:getRecentsModified */ /* deal:getRecentlyCreated deal:getRecentlyModified */
/* -------------------------------------------------------------------------- */ /* -------------------------------------------------------------------------- */
{ {
displayName: 'Return All', displayName: 'Return All',
@@ -418,8 +418,8 @@ export const dealFields = [
'deal', 'deal',
], ],
operation: [ operation: [
'getRecentsCreated', 'getRecentlyCreated',
'getRecentsModified', 'getRecentlyModified',
], ],
}, },
}, },
@@ -436,8 +436,8 @@ export const dealFields = [
'deal', 'deal',
], ],
operation: [ operation: [
'getRecentsCreated', 'getRecentlyCreated',
'getRecentsModified', 'getRecentlyModified',
], ],
returnAll: [ returnAll: [
false, false,
@@ -463,8 +463,8 @@ export const dealFields = [
'deal', 'deal',
], ],
operation: [ operation: [
'getRecentsCreated', 'getRecentlyCreated',
'getRecentsModified', 'getRecentlyModified',
], ],
}, },
}, },

View File

@@ -320,7 +320,7 @@ export class Hubspot implements INodeType {
throw new Error(`Hubspot Error: ${JSON.stringify(err)}`); throw new Error(`Hubspot Error: ${JSON.stringify(err)}`);
} }
} }
if (operation === 'getRecentsCreated' || operation === 'getRecentsModified') { if (operation === 'getRecentlyCreated' || operation === 'getRecentlyModified') {
let endpoint; let endpoint;
const filters = this.getNodeParameter('filters', i) as IDataObject; const filters = this.getNodeParameter('filters', i) as IDataObject;
const returnAll = this.getNodeParameter('returnAll', 0) as boolean; const returnAll = this.getNodeParameter('returnAll', 0) as boolean;
@@ -331,7 +331,7 @@ export class Hubspot implements INodeType {
qs.includePropertyVersions = filters.includePropertyVersions as boolean; qs.includePropertyVersions = filters.includePropertyVersions as boolean;
} }
try { try {
if (operation === 'getRecentsCreated') { if (operation === 'getRecentlyCreated') {
endpoint = `/deals/v1/deal/recent/created`; endpoint = `/deals/v1/deal/recent/created`;
} else { } else {
endpoint = `/deals/v1/deal/recent/modified`; endpoint = `/deals/v1/deal/recent/modified`;