This commit is contained in:
kodaho 2025-03-05 17:03:06 +01:00 committed by GitHub
commit 31e7421d26
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -113,8 +113,13 @@ 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]
.split(';')[0]
.replace('<', '')
.replace('>', '');
}
returnData.push.apply(returnData, responseData.body[propertyName] as IDataObject[]);
} while (responseData.headers.link?.includes('rel="next"'));