Small improvements to Hubspot-Node

This commit is contained in:
Jan Oberhauser 2020-08-25 09:52:00 +02:00
parent f9f88cbfd0
commit ad67d020c0
2 changed files with 29 additions and 49 deletions

View file

@ -884,52 +884,6 @@ export const contactFields = [
default: 100,
description: 'How many results to return.',
},
{
displayName: 'Sort By',
name: 'sorts',
type: 'options',
typeOptions: {
loadOptionsMethod: 'getContactProperties',
},
displayOptions: {
show: {
resource: [
'contact',
],
operation: [
'search',
],
},
},
default: [],
},
{
displayName: 'Direction',
name: 'direction',
type: 'options',
options: [
{
name: 'ASC',
value: 'ASCENDING',
},
{
name: 'DESC',
value: 'DESCENDING',
},
],
displayOptions: {
show: {
resource: [
'contact',
],
operation: [
'search',
],
},
},
default: 'DESCENDING',
description: 'Defines the direction in which search results are ordered. Default value is DESC.',
},
{
displayName: 'Filter Groups',
name: 'filterGroupsUi',
@ -1071,6 +1025,23 @@ export const contactFields = [
},
},
options: [
{
displayName: 'Direction',
name: 'direction',
type: 'options',
options: [
{
name: 'ASC',
value: 'ASCENDING',
},
{
name: 'DESC',
value: 'DESCENDING',
},
],
default: 'DESCENDING',
description: 'Defines the direction in which search results are ordered. Default value is DESC.',
},
{
displayName: 'Fields',
name: 'properties',
@ -1095,6 +1066,15 @@ export const contactFields = [
default: '',
description: 'Perform a text search against all property values for an object type',
},
{
displayName: 'Sort By',
name: 'sortBy',
type: 'options',
typeOptions: {
loadOptionsMethod: 'getContactProperties',
},
default: 'createdate',
},
],
},
] as INodeProperties[];

View file

@ -1171,13 +1171,13 @@ export class Hubspot implements INodeType {
const additionalFields = this.getNodeParameter('additionalFields', i) as IDataObject;
const returnAll = this.getNodeParameter('returnAll', 0) as boolean;
const filtersGroupsUi = this.getNodeParameter('filterGroupsUi', i) as IDataObject;
const sorts = this.getNodeParameter('sorts', i) as string;
const direction = this.getNodeParameter('direction', i) as string;
const sortBy = additionalFields.sortBy || 'createdate';
const direction = additionalFields.direction || 'DESCENDING';
const body: IDataObject = {
sorts: [
{
propertyName: sorts,
propertyName: sortBy,
direction,
},
],