Add info to query result payload (#10291)
This commit is contained in:
parent
5f883ec42c
commit
5e76a50b0b
|
@ -245,7 +245,7 @@ async function execute(
|
||||||
}
|
}
|
||||||
const runFn = () => Runner.run(inputs)
|
const runFn = () => Runner.run(inputs)
|
||||||
|
|
||||||
const { rows, pagination, extra } = await quotas.addQuery(runFn, {
|
const { rows, pagination, extra, info } = await quotas.addQuery(runFn, {
|
||||||
datasourceId: datasource._id,
|
datasourceId: datasource._id,
|
||||||
})
|
})
|
||||||
// remove the raw from execution incase transformer being used to hide data
|
// remove the raw from execution incase transformer being used to hide data
|
||||||
|
@ -255,7 +255,7 @@ async function execute(
|
||||||
if (opts && opts.rowsOnly) {
|
if (opts && opts.rowsOnly) {
|
||||||
ctx.body = rows
|
ctx.body = rows
|
||||||
} else {
|
} else {
|
||||||
ctx.body = { data: rows, pagination, ...extra }
|
ctx.body = { data: rows, pagination, ...extra, ...info }
|
||||||
}
|
}
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
ctx.throw(400, err)
|
ctx.throw(400, err)
|
||||||
|
|
Loading…
Reference in New Issue