🐛 Fix issue with not returning more than 1000 items

This commit is contained in:
Jan Oberhauser 2022-01-21 14:10:30 +01:00
parent 1566dafb3e
commit 4c029e5401

View file

@ -66,7 +66,8 @@ export async function spotifyApiRequestAllItems(this: IHookFunctions | IExecuteF
uri = responseData.next || responseData[propertyName.split('.')[0]].next; uri = responseData.next || responseData[propertyName.split('.')[0]].next;
//remove the query as the query parameters are already included in the next, else api throws error. //remove the query as the query parameters are already included in the next, else api throws error.
query = {}; query = {};
if (uri?.includes('offset=1000')) { if (uri?.includes('offset=1000') && endpoint === '/search') {
// The search endpoint has a limit of 1000 so step before it returns a 404
return returnData; return returnData;
} }
} while ( } while (