From c45c3ffb8f694a73c7ee06c0ffd1daaf676f1dbb Mon Sep 17 00:00:00 2001 From: mike12345567 Date: Thu, 22 Feb 2024 17:54:26 +0000 Subject: [PATCH] Setting disabled source types. --- packages/server/src/api/controllers/integration.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/packages/server/src/api/controllers/integration.ts b/packages/server/src/api/controllers/integration.ts index f7a4f9ee28..9cfde31e4c 100644 --- a/packages/server/src/api/controllers/integration.ts +++ b/packages/server/src/api/controllers/integration.ts @@ -1,15 +1,19 @@ import { getDefinition, getDefinitions } from "../../integrations" import { SourceName, UserCtx } from "@budibase/types" +const DISABLED_EXTERNAL_INTEGRATIONS = [SourceName.AIRTABLE] + export async function fetch(ctx: UserCtx) { const definitions = await getDefinitions() - delete definitions.AIRTABLE + for (let disabledIntegration of DISABLED_EXTERNAL_INTEGRATIONS) { + delete definitions[disabledIntegration] + } ctx.body = definitions } export async function find(ctx: UserCtx) { const sourceType = ctx.params?.type - if (sourceType === SourceName.AIRTABLE) { + if (DISABLED_EXTERNAL_INTEGRATIONS.indexOf(sourceType) !== -1) { ctx.throw(400, `Invalid source type - ${sourceType} is not supported.`) } ctx.body = await getDefinition(ctx.params.type)