mirror of
https://github.com/n8n-io/n8n.git
synced 2024-11-10 14:44:05 -08:00
⚡ Small improvements to Hubspot-Node
This commit is contained in:
parent
f9f88cbfd0
commit
ad67d020c0
|
@ -884,52 +884,6 @@ export const contactFields = [
|
||||||
default: 100,
|
default: 100,
|
||||||
description: 'How many results to return.',
|
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',
|
displayName: 'Filter Groups',
|
||||||
name: 'filterGroupsUi',
|
name: 'filterGroupsUi',
|
||||||
|
@ -1071,6 +1025,23 @@ export const contactFields = [
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
options: [
|
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',
|
displayName: 'Fields',
|
||||||
name: 'properties',
|
name: 'properties',
|
||||||
|
@ -1095,6 +1066,15 @@ export const contactFields = [
|
||||||
default: '',
|
default: '',
|
||||||
description: 'Perform a text search against all property values for an object type',
|
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[];
|
] as INodeProperties[];
|
||||||
|
|
|
@ -1171,13 +1171,13 @@ export class Hubspot implements INodeType {
|
||||||
const additionalFields = this.getNodeParameter('additionalFields', i) as IDataObject;
|
const additionalFields = this.getNodeParameter('additionalFields', i) as IDataObject;
|
||||||
const returnAll = this.getNodeParameter('returnAll', 0) as boolean;
|
const returnAll = this.getNodeParameter('returnAll', 0) as boolean;
|
||||||
const filtersGroupsUi = this.getNodeParameter('filterGroupsUi', i) as IDataObject;
|
const filtersGroupsUi = this.getNodeParameter('filterGroupsUi', i) as IDataObject;
|
||||||
const sorts = this.getNodeParameter('sorts', i) as string;
|
const sortBy = additionalFields.sortBy || 'createdate';
|
||||||
const direction = this.getNodeParameter('direction', i) as string;
|
const direction = additionalFields.direction || 'DESCENDING';
|
||||||
|
|
||||||
const body: IDataObject = {
|
const body: IDataObject = {
|
||||||
sorts: [
|
sorts: [
|
||||||
{
|
{
|
||||||
propertyName: sorts,
|
propertyName: sortBy,
|
||||||
direction,
|
direction,
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
|
|
Loading…
Reference in a new issue