1
0
Fork 0
mirror of synced 2024-10-03 10:36:59 +13:00

Return top level pagination info from query execution

This commit is contained in:
Andrew Kingston 2021-12-17 19:00:23 +00:00
parent 0cfd28fe27
commit 8cee08ca03

View file

@ -139,7 +139,7 @@ async function execute(ctx, opts = { rowsOnly: false }) {
// call the relevant CRUD method on the integration class
try {
const { rows, extra } = await Runner.run({
const { rows, pagination, extra } = await Runner.run({
appId: ctx.appId,
datasource,
queryVerb: query.queryVerb,
@ -151,7 +151,7 @@ async function execute(ctx, opts = { rowsOnly: false }) {
if (opts && opts.rowsOnly) {
ctx.body = rows
} else {
ctx.body = { data: rows, ...extra }
ctx.body = { data: rows, pagination, ...extra }
}
} catch (err) {
ctx.throw(400, err)