Fix types

This commit is contained in:
Adria Navarro 2023-05-15 12:41:14 +02:00
parent eaf7e399e7
commit c3856a48aa
2 changed files with 4 additions and 4 deletions

View File

@ -1,4 +1,4 @@
import { getDefinitions } from "../../integrations"
import { getDefinition, getDefinitions } from "../../integrations"
import { BBContext } from "@budibase/types"
export async function fetch(ctx: BBContext) {
@ -7,7 +7,7 @@ export async function fetch(ctx: BBContext) {
}
export async function find(ctx: BBContext) {
const defs = await getDefinitions()
const def = await getDefinition(ctx.params.type)
ctx.body = def
ctx.status = 200
ctx.body = defs[ctx.params.type]
}

View File

@ -41,7 +41,7 @@ async function enrichDatasourceWithValues(datasource: Datasource) {
{ onlyFound: true }
) as Datasource
const definition = await getDefinition(processed.source)
processed.config = checkDatasourceTypes(definition, processed.config)
processed.config = checkDatasourceTypes(definition!, processed.config)
return {
datasource: processed,
envVars: env as Record<string, string>,