mirror of
https://github.com/n8n-io/n8n.git
synced 2024-12-24 20:24:05 -08:00
fix(Supabase Node): Pagination for get all rows (#8311)
This commit is contained in:
parent
1a0e285553
commit
e0804768e8
|
@ -310,12 +310,18 @@ export class Supabase implements INodeType {
|
||||||
qs.limit = this.getNodeParameter('limit', 0);
|
qs.limit = this.getNodeParameter('limit', 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
let rows;
|
let rows: IDataObject[] = [];
|
||||||
|
|
||||||
try {
|
try {
|
||||||
rows = await supabaseApiRequest.call(this, 'GET', endpoint, {}, qs);
|
let responseLength = 0;
|
||||||
|
do {
|
||||||
|
const newRows = await supabaseApiRequest.call(this, 'GET', endpoint, {}, qs);
|
||||||
|
responseLength = newRows.length;
|
||||||
|
rows = rows.concat(newRows);
|
||||||
|
qs.offset = rows.length;
|
||||||
|
} while (responseLength >= 1000);
|
||||||
const executionData = this.helpers.constructExecutionMetaData(
|
const executionData = this.helpers.constructExecutionMetaData(
|
||||||
this.helpers.returnJsonArray(rows as IDataObject[]),
|
this.helpers.returnJsonArray(rows),
|
||||||
{ itemData: { item: i } },
|
{ itemData: { item: i } },
|
||||||
);
|
);
|
||||||
returnData.push(...executionData);
|
returnData.push(...executionData);
|
||||||
|
|
Loading…
Reference in a new issue