From 071ab40c9fa523b8ee47c9428ee6078e43985816 Mon Sep 17 00:00:00 2001 From: Jonathan Bennetts Date: Fri, 2 Sep 2022 15:47:03 +0100 Subject: [PATCH] fix(shopify Node): fix pagination when empty fields are sent --- .../nodes-base/nodes/Shopify/GenericFunctions.ts | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/packages/nodes-base/nodes/Shopify/GenericFunctions.ts b/packages/nodes-base/nodes/Shopify/GenericFunctions.ts index f174af4df4..3c014d71f4 100644 --- a/packages/nodes-base/nodes/Shopify/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Shopify/GenericFunctions.ts @@ -88,6 +88,18 @@ export async function shopifyApiRequestAllItems( ): Promise { 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;