From 2bf724b9b3bdc9bb5fc76e55059e7d9bb7d946b3 Mon Sep 17 00:00:00 2001 From: Dean Date: Tue, 10 Jan 2023 09:50:32 +0000 Subject: [PATCH] Updated cleanExportRows import --- packages/server/src/api/controllers/row/external.ts | 2 +- packages/server/src/api/controllers/row/internal.ts | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/packages/server/src/api/controllers/row/external.ts b/packages/server/src/api/controllers/row/external.ts index 77168b61c9..02c218c7e3 100644 --- a/packages/server/src/api/controllers/row/external.ts +++ b/packages/server/src/api/controllers/row/external.ts @@ -20,7 +20,7 @@ import { Datasource, } from "@budibase/types" -const { cleanExportRows } = require("../row/utils") +const { cleanExportRows } = require("./utils") export async function handleRequest( operation: Operation, diff --git a/packages/server/src/api/controllers/row/internal.ts b/packages/server/src/api/controllers/row/internal.ts index 824520d8f8..e422d63ec5 100644 --- a/packages/server/src/api/controllers/row/internal.ts +++ b/packages/server/src/api/controllers/row/internal.ts @@ -38,6 +38,8 @@ import { Table, } from "@budibase/types" +const { cleanExportRows } = require("./utils") + const CALCULATION_TYPES = { SUM: "sum", COUNT: "count", @@ -417,7 +419,7 @@ export async function exportRows(ctx: Ctx) { let rows: Row[] = [] let schema = table.schema - // // Filter data to only specified columns if required + // Filter data to only specified columns if required if (columns && columns.length) { for (let i = 0; i < result.length; i++) { rows[i] = {} @@ -429,8 +431,7 @@ export async function exportRows(ctx: Ctx) { rows = result } - // @ts-ignore - let exportRows = cleanExportRows(rows, schema, format, columns) //this isnt correct + let exportRows = cleanExportRows(rows, schema, format, columns) let headers = Object.keys(schema) // @ts-ignore