Merge pull request #13112 from Budibase/remove-airtable-from-data-source-ui
Remove Airtable from data source ui
This commit is contained in:
commit
d2e28d3e65
|
@ -1,13 +1,20 @@
|
||||||
import { getDefinition, getDefinitions } from "../../integrations"
|
import { getDefinition, getDefinitions } from "../../integrations"
|
||||||
import { BBContext } from "@budibase/types"
|
import { SourceName, UserCtx } from "@budibase/types"
|
||||||
|
|
||||||
export async function fetch(ctx: BBContext) {
|
const DISABLED_EXTERNAL_INTEGRATIONS = [SourceName.AIRTABLE]
|
||||||
ctx.status = 200
|
|
||||||
ctx.body = await getDefinitions()
|
export async function fetch(ctx: UserCtx) {
|
||||||
|
const definitions = await getDefinitions()
|
||||||
|
for (let disabledIntegration of DISABLED_EXTERNAL_INTEGRATIONS) {
|
||||||
|
delete definitions[disabledIntegration]
|
||||||
|
}
|
||||||
|
ctx.body = definitions
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function find(ctx: BBContext) {
|
export async function find(ctx: UserCtx) {
|
||||||
const def = await getDefinition(ctx.params.type)
|
const sourceType = ctx.params?.type
|
||||||
ctx.body = def
|
if (DISABLED_EXTERNAL_INTEGRATIONS.indexOf(sourceType) !== -1) {
|
||||||
ctx.status = 200
|
ctx.throw(400, `Invalid source type - ${sourceType} is not supported.`)
|
||||||
|
}
|
||||||
|
ctx.body = await getDefinition(ctx.params.type)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue