fix(QuickBooks Node) Fix pagination (#3169)

* Fixed pagination issue

* Removed unused import
This commit is contained in:
Jonathan Bennetts 2022-04-22 11:41:07 +01:00 committed by GitHub
parent bc5749b7ae
commit a790dcae3d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -7,7 +7,6 @@ import {
IDataObject,
ILoadOptionsFunctions,
INodeExecutionData,
INodeProperties,
INodePropertyOptions,
NodeApiError,
} from 'n8n-workflow';
@ -126,7 +125,11 @@ export async function quickBooksApiRequestAllItems(
const maxResults = 1000;
const returnData: IDataObject[] = [];
const maxCount = await getCount.call(this, method, endpoint, qs);
const maxCountQuery = {
query: `SELECT COUNT(*) FROM ${resource}`,
} as IDataObject;
const maxCount = await getCount.call(this, method, endpoint, maxCountQuery);
const originalQuery = qs.query as string;