mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 18:12:04 +00:00
✨ Extended Hubspot
This commit is contained in:
@@ -4,9 +4,9 @@ import {
|
||||
|
||||
import {
|
||||
IExecuteFunctions,
|
||||
IExecuteSingleFunctions,
|
||||
IHookFunctions,
|
||||
ILoadOptionsFunctions,
|
||||
IExecuteSingleFunctions,
|
||||
} from 'n8n-core';
|
||||
|
||||
import {
|
||||
@@ -31,11 +31,10 @@ export async function hubspotApiRequest(this: IHookFunctions | IExecuteFunctions
|
||||
try {
|
||||
return await this.helpers.request!(options);
|
||||
} catch (error) {
|
||||
|
||||
if (error.response && error.response.body && error.response.body.errors) {
|
||||
// Try to return the error prettier
|
||||
const errorMessages = error.response.body.errors.map((e: IDataObject) => e.message);
|
||||
throw new Error(`Hubspot error response [${error.statusCode}]: ${errorMessages.join(' | ')}`);
|
||||
const errorMessages = error.response.body.errors;
|
||||
throw new Error(`Hubspot error response [${error.statusCode}]: ${errorMessages.join('|')}`);
|
||||
}
|
||||
|
||||
throw error;
|
||||
@@ -54,6 +53,7 @@ export async function hubspotApiRequestAllItems(this: IHookFunctions | IExecuteF
|
||||
|
||||
query.limit = query.limit || 250;
|
||||
query.count = 100;
|
||||
body.limit = body.limit || 100;
|
||||
|
||||
do {
|
||||
responseData = await hubspotApiRequest.call(this, method, endpoint, body, query);
|
||||
|
||||
Reference in New Issue
Block a user