mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 18:12:04 +00:00
fix(Hubspot Node): Fix loading of Contacts (#3426)
This commit is contained in:
@@ -911,12 +911,16 @@ export class Hubspot implements INodeType {
|
|||||||
const returnData: INodePropertyOptions[] = [];
|
const returnData: INodePropertyOptions[] = [];
|
||||||
const endpoint = '/contacts/v1/lists/all/contacts/all';
|
const endpoint = '/contacts/v1/lists/all/contacts/all';
|
||||||
const contacts = await hubspotApiRequestAllItems.call(this, 'contacts', 'GET', endpoint);
|
const contacts = await hubspotApiRequestAllItems.call(this, 'contacts', 'GET', endpoint);
|
||||||
|
|
||||||
for (const contact of contacts) {
|
for (const contact of contacts) {
|
||||||
const contactName = `${contact.properties.firstname.value} ${contact.properties.lastname.value}`;
|
const firstName = contact.properties?.firstname?.value || '';
|
||||||
|
const lastName = contact.properties?.lastname?.value || '';
|
||||||
|
const contactName = `${firstName} ${lastName}`;
|
||||||
const contactId = contact.vid;
|
const contactId = contact.vid;
|
||||||
returnData.push({
|
returnData.push({
|
||||||
name: contactName,
|
name: contactName,
|
||||||
value: contactId,
|
value: contactId,
|
||||||
|
description: `Contact VID: ${contactId}`,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
return returnData.sort((a, b) => a.name < b.name ? 0 : 1);
|
return returnData.sort((a, b) => a.name < b.name ? 0 : 1);
|
||||||
|
|||||||
Reference in New Issue
Block a user