fix(HubSpot Node): Migrate from v2 owners api (#10013)

This commit is contained in:
Jon
2024-07-12 08:29:05 +01:00
committed by GitHub
parent 47882161c8
commit 56dd491bca
2 changed files with 12 additions and 12 deletions

View File

@@ -862,11 +862,11 @@ export class HubspotV1 implements INodeType {
// select them easily
async getOwners(this: ILoadOptionsFunctions): Promise<INodePropertyOptions[]> {
const returnData: INodePropertyOptions[] = [];
const endpoint = '/owners/v2/owners';
const owners = await hubspotApiRequest.call(this, 'GET', endpoint);
for (const owner of owners) {
const endpoint = '/crm/v3/owners';
const { results } = await hubspotApiRequest.call(this, 'GET', endpoint);
for (const owner of results) {
const ownerName = owner.email;
const ownerId = owner.ownerId;
const ownerId = isNaN(parseInt(owner.id)) ? owner.id : parseInt(owner.id);
returnData.push({
name: ownerName,
value: ownerId,