From 79f2e9d9701c3b790fa74a8a83d32606144534b2 Mon Sep 17 00:00:00 2001 From: mike12345567 Date: Tue, 14 Mar 2023 17:04:25 +0000 Subject: [PATCH] Fixing build issue. --- .../server/src/api/controllers/table/index.ts | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/packages/server/src/api/controllers/table/index.ts b/packages/server/src/api/controllers/table/index.ts index aa6dfde536..2ab7ad7b38 100644 --- a/packages/server/src/api/controllers/table/index.ts +++ b/packages/server/src/api/controllers/table/index.ts @@ -8,7 +8,7 @@ import { import { isExternalTable, isSQL } from "../../../integrations/utils" import { getDatasourceParams } from "../../../db/utils" import { context, events } from "@budibase/backend-core" -import { Table, BBContext } from "@budibase/types" +import { Table, UserCtx } from "@budibase/types" import sdk from "../../../sdk" import csv from "csvtojson" @@ -25,7 +25,7 @@ function pickApi({ tableId, table }: { tableId?: string; table?: Table }) { } // covers both internal and external -export async function fetch(ctx: BBContext) { +export async function fetch(ctx: UserCtx) { const db = context.getAppDB() const internal = await sdk.tables.getAllInternalTables() @@ -53,12 +53,12 @@ export async function fetch(ctx: BBContext) { ctx.body = [...internal, ...external] } -export async function find(ctx: BBContext) { +export async function find(ctx: UserCtx) { const tableId = ctx.params.tableId ctx.body = await sdk.tables.getTable(tableId) } -export async function save(ctx: BBContext) { +export async function save(ctx: UserCtx) { const appId = ctx.appId const table = ctx.request.body const isImport = table.rows @@ -79,7 +79,7 @@ export async function save(ctx: BBContext) { ctx.body = savedTable } -export async function destroy(ctx: BBContext) { +export async function destroy(ctx: UserCtx) { const appId = ctx.appId const tableId = ctx.params.tableId const deletedTable = await pickApi({ tableId }).destroy(ctx) @@ -91,7 +91,7 @@ export async function destroy(ctx: BBContext) { ctx.body = { message: `Table ${tableId} deleted.` } } -export async function bulkImport(ctx: BBContext) { +export async function bulkImport(ctx: UserCtx) { const tableId = ctx.params.tableId await pickApi({ tableId }).bulkImport(ctx) // right now we don't trigger anything for bulk import because it @@ -101,7 +101,7 @@ export async function bulkImport(ctx: BBContext) { ctx.body = { message: `Bulk rows created.` } } -export async function csvToJson(ctx: BBContext) { +export async function csvToJson(ctx: UserCtx) { const { csvString } = ctx.request.body const result = await csv().fromString(csvString) @@ -110,7 +110,7 @@ export async function csvToJson(ctx: BBContext) { ctx.body = result } -export async function validateNewTableImport(ctx: BBContext) { +export async function validateNewTableImport(ctx: UserCtx) { const { rows, schema }: { rows: unknown; schema: unknown } = ctx.request.body if (isRows(rows) && isSchema(schema)) { @@ -121,7 +121,7 @@ export async function validateNewTableImport(ctx: BBContext) { } } -export async function validateExistingTableImport(ctx: BBContext) { +export async function validateExistingTableImport(ctx: UserCtx) { const { rows, tableId }: { rows: unknown; tableId: unknown } = ctx.request.body