Handle config

This commit is contained in:
Adria Navarro 2023-05-16 10:44:41 +02:00
parent cd93d327a5
commit a676e42b1f
2 changed files with 3 additions and 5 deletions

View File

@ -129,11 +129,9 @@ export async function verify(
) { ) {
const { datasource } = ctx.request.body const { datasource } = ctx.request.body
const { config: { auth } = {} } = await sdk.datasources.get(datasource._id!) const { config } = await sdk.datasources.get(datasource._id!)
const connector = await getConnector( const connector = await getConnector(_.merge(datasource, { config }))
_.merge({ config: { auth } }, datasource)
)
if (!connector.testConnection) { if (!connector.testConnection) {
ctx.throw(400, "Connection information verification not supported") ctx.throw(400, "Connection information verification not supported")
} }

View File

@ -9,7 +9,7 @@ export interface Datasource extends Document {
// the config is defined by the schema // the config is defined by the schema
config?: { config?: {
[key: string]: string | number | boolean | any[] [key: string]: string | number | boolean | any[]
} & { auth?: object } }
plus?: boolean plus?: boolean
entities?: { entities?: {
[key: string]: Table [key: string]: Table