refactor: migrate away from querystring (#4180)

refactor: migrate away from querystring
This commit is contained in:
Michael Kret
2022-09-23 17:48:45 +03:00
committed by GitHub
parent 27e2ce0470
commit 7aa40bf95d
3 changed files with 12 additions and 12 deletions

View File

@@ -11,8 +11,6 @@ import { IDataObject, NodeApiError, NodeOperationError } from 'n8n-workflow';
import { get } from 'lodash';
import querystring from 'querystring';
export async function travisciApiRequest(
this: IHookFunctions | IExecuteFunctions | IExecuteSingleFunctions | ILoadOptionsFunctions,
method: string,
@@ -71,7 +69,8 @@ export async function travisciApiRequestAllItems(
responseData = await travisciApiRequest.call(this, method, resource, body, query);
const path = get(responseData, '@pagination.next.@href');
if (path !== undefined) {
query = querystring.parse(path);
const parsedPath = new URLSearchParams(path);
query = Object.fromEntries(parsedPath);
}
returnData.push.apply(returnData, responseData[propertyName]);
} while (responseData['@pagination']['is_last'] !== true);