mirror of
https://github.com/n8n-io/n8n.git
synced 2025-02-21 02:56:40 -08:00
fix(shopify): prevent infinite loop during all items request
This commit is contained in:
parent
ac84ea1445
commit
8c11edd7e0
|
@ -113,8 +113,12 @@ export async function shopifyApiRequestAllItems(
|
|||
responseData = await shopifyApiRequest.call(this, method, resource, body, query, uri, {
|
||||
resolveWithFullResponse: true,
|
||||
});
|
||||
if (responseData.headers.link) {
|
||||
uri = responseData.headers.link.split(';')[0].replace('<', '').replace('>', '');
|
||||
if (responseData.headers.link?.includes('rel="next"')) {
|
||||
uri = responseData.headers.link
|
||||
.split(';')
|
||||
.filter((s: string) => s.includes('rel="next"'))[0]
|
||||
.replace('<', '')
|
||||
.replace('>', '');
|
||||
}
|
||||
returnData.push.apply(returnData, responseData.body[propertyName] as IDataObject[]);
|
||||
} while (responseData.headers.link?.includes('rel="next"'));
|
||||
|
|
Loading…
Reference in a new issue