fix(shopify Node): fix pagination when empty fields are sent

This commit is contained in:
Jonathan Bennetts 2022-09-02 15:47:03 +01:00 committed by GitHub
parent 82827d0a12
commit 071ab40c9f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -88,6 +88,18 @@ export async function shopifyApiRequestAllItems(
): Promise<any> {
const returnData: IDataObject[] = [];
/*
When paginating some parameters
(e.g. product:getAll -> title ) cannot
be empty in the query string, so remove
all the empty ones before paginating.
*/
for (const field in query) {
if (query[field] === '') {
delete query[field];
}
}
let responseData;
let uri: string | undefined;