From 8cee08ca03616d417a7db87c1c0c06fc31466884 Mon Sep 17 00:00:00 2001 From: Andrew Kingston Date: Fri, 17 Dec 2021 19:00:23 +0000 Subject: [PATCH] Return top level pagination info from query execution --- packages/server/src/api/controllers/query/index.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/server/src/api/controllers/query/index.js b/packages/server/src/api/controllers/query/index.js index 4c7c7398be..28dcbb1548 100644 --- a/packages/server/src/api/controllers/query/index.js +++ b/packages/server/src/api/controllers/query/index.js @@ -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)