Setting disabled source types.
This commit is contained in:
parent
5dd87265d2
commit
c45c3ffb8f
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue