From b60794d73ad0dff989432bf3da4aff551555350a Mon Sep 17 00:00:00 2001 From: Rory Powell Date: Thu, 20 Jul 2023 11:13:57 +0100 Subject: [PATCH 1/2] Update pro reference to latest develop and fix compile errors --- packages/pro | 2 +- packages/server/src/api/controllers/query/index.ts | 4 ++-- packages/server/src/api/controllers/row/index.ts | 6 +++--- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/packages/pro b/packages/pro index 9c564edb37..4d9840700e 160000 --- a/packages/pro +++ b/packages/pro @@ -1 +1 @@ -Subproject commit 9c564edb37cb619cb5971e10c4317fa6e7c5bb00 +Subproject commit 4d9840700e7684581c39965b7cb6a2b2428c477c diff --git a/packages/server/src/api/controllers/query/index.ts b/packages/server/src/api/controllers/query/index.ts index 4c1cad6b5b..466fe90e07 100644 --- a/packages/server/src/api/controllers/query/index.ts +++ b/packages/server/src/api/controllers/query/index.ts @@ -157,7 +157,7 @@ export async function preview(ctx: any) { } const runFn = () => Runner.run(inputs) - const { rows, keys, info, extra } = await quotas.addQuery(runFn, { + const { rows, keys, info, extra } = await quotas.addQuery(runFn, { datasourceId: datasource._id, }) const schemaFields: any = {} @@ -246,7 +246,7 @@ async function execute( } const runFn = () => Runner.run(inputs) - const { rows, pagination, extra, info } = await quotas.addQuery(runFn, { + const { rows, pagination, extra, info } = await quotas.addQuery(runFn, { datasourceId: datasource._id, }) // remove the raw from execution incase transformer being used to hide data diff --git a/packages/server/src/api/controllers/row/index.ts b/packages/server/src/api/controllers/row/index.ts index 673f2adb53..aa3aa3e21c 100644 --- a/packages/server/src/api/controllers/row/index.ts +++ b/packages/server/src/api/controllers/row/index.ts @@ -25,7 +25,7 @@ export async function patch(ctx: any): Promise { return save(ctx) } try { - const { row, table } = await quotas.addQuery( + const { row, table } = await quotas.addQuery( () => pickApi(tableId).patch(ctx), { datasourceId: tableId, @@ -104,7 +104,7 @@ export async function destroy(ctx: any) { const tableId = utils.getTableId(ctx) let response, row if (inputs.rows) { - let { rows } = await quotas.addQuery( + let { rows } = await quotas.addQuery( () => pickApi(tableId).bulkDestroy(ctx), { datasourceId: tableId, @@ -117,7 +117,7 @@ export async function destroy(ctx: any) { gridSocket?.emitRowDeletion(ctx, row._id) } } else { - let resp = await quotas.addQuery(() => pickApi(tableId).destroy(ctx), { + let resp = await quotas.addQuery(() => pickApi(tableId).destroy(ctx), { datasourceId: tableId, }) await quotas.removeRow() From 76f61cfd3a983d3513c010bd6572fbb879abb07d Mon Sep 17 00:00:00 2001 From: Rory Powell Date: Thu, 20 Jul 2023 11:21:34 +0100 Subject: [PATCH 2/2] Lint --- packages/server/src/api/controllers/query/index.ts | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/packages/server/src/api/controllers/query/index.ts b/packages/server/src/api/controllers/query/index.ts index 466fe90e07..11ad25f037 100644 --- a/packages/server/src/api/controllers/query/index.ts +++ b/packages/server/src/api/controllers/query/index.ts @@ -246,9 +246,12 @@ async function execute( } const runFn = () => Runner.run(inputs) - const { rows, pagination, extra, info } = await quotas.addQuery(runFn, { - datasourceId: datasource._id, - }) + const { rows, pagination, extra, info } = await quotas.addQuery( + runFn, + { + datasourceId: datasource._id, + } + ) // remove the raw from execution incase transformer being used to hide data if (extra?.raw) { delete extra.raw