fix(HubSpot Node): Migrate from v2 owners api (#10013)
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user