Handle config
This commit is contained in:
parent
cd93d327a5
commit
a676e42b1f
|
@ -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")
|
||||||
}
|
}
|
||||||
|
|
|
@ -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
|
||||||
|
|
Loading…
Reference in New Issue