From 2d5818ae335d2b9f588aa037ebd3afc25ddee3fd Mon Sep 17 00:00:00 2001 From: mike12345567 Date: Wed, 18 Oct 2023 18:58:58 +0100 Subject: [PATCH] Updating datasource controller to use SDK rather than calling through controllers. --- packages/server/src/api/controllers/datasource.ts | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/packages/server/src/api/controllers/datasource.ts b/packages/server/src/api/controllers/datasource.ts index 8e6a0620da..b50c2464f0 100644 --- a/packages/server/src/api/controllers/datasource.ts +++ b/packages/server/src/api/controllers/datasource.ts @@ -4,7 +4,6 @@ import { getQueryParams, getTableParams, } from "../../db/utils" -import { destroy as tableDestroy } from "./table/internal" import { getIntegration } from "../../integrations" import { invalidateDynamicVariables } from "../../threads/utils" import { context, db as dbCore, events } from "@budibase/backend-core" @@ -325,11 +324,7 @@ async function destroyInternalTablesBySourceId(datasourceId: string) { // Destroy the tables. for (const table of datasourceTableDocs) { - await tableDestroy({ - params: { - tableId: table._id, - }, - }) + await sdk.tables.internal.destroy(table) } }