Skip to content

Commit

Permalink
⚡ Include also data of last request
Browse files Browse the repository at this point in the history
  • Loading branch information
janober committed Oct 31, 2023
1 parent f758af6 commit 005914d
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 9 deletions.
18 changes: 9 additions & 9 deletions packages/core/src/NodeExecuteFunctions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2683,9 +2683,18 @@ const getRequestHelperFunctions = (
hashData.previousLength = contentLength;
}

responseData.push(tempResponseData);

additionalKeys.$response = newResponse;
additionalKeys.$count = additionalKeys.$count + 1;

if (
paginationOptions.maxRequests &&
additionalKeys.$count >= paginationOptions.maxRequests
) {
break;
}

makeAdditionalRequest = getResolvedValue(
paginationOptions.continue,
itemIndex,
Expand Down Expand Up @@ -2727,15 +2736,6 @@ const getRequestHelperFunctions = (
},
);
}

responseData.push(tempResponseData);
}

if (
paginationOptions.maxRequests &&
additionalKeys.$count >= paginationOptions.maxRequests
) {
break;
}
} while (makeAdditionalRequest);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1015,6 +1015,11 @@
"json": {
"data": "[{\"id\":12},{\"id\":13},{\"id\":14}]"
}
},
{
"json": {
"data": "[]"
}
}
],
"Response Empty Next with Max Pages": [
Expand Down Expand Up @@ -1123,6 +1128,17 @@
"statusCode": 200,
"statusMessage": null
}
},
{
"json": {
"data": "[]",
"headers": {
"content-type": "application/json",
"next-url": "https://dummyjson.com/users?skip=20&limit=4"
},
"statusCode": 404,
"statusMessage": null
}
}
],
"Complete Expression - JSON": [
Expand Down Expand Up @@ -1327,6 +1343,11 @@
"json": {
"data": "[{\"id\":12},{\"id\":13},{\"id\":14}]"
}
},
{
"json": {
"data": "[]"
}
}
],
"Response Empty - Include Full Response1": [
Expand Down Expand Up @@ -1373,6 +1394,17 @@
"statusCode": 200,
"statusMessage": null
}
},
{
"json": {
"data": "[]",
"headers": {
"content-type": "text/plain",
"next-url": "https://dummyjson.com/users?skip=20&limit=4"
},
"statusCode": 404,
"statusMessage": null
}
}
]
},
Expand Down

0 comments on commit 005914d

Please sign in to comment.