From a676e42b1f356dc3fd563dd12a62ad20abf7eb40 Mon Sep 17 00:00:00 2001 From: Adria Navarro Date: Tue, 16 May 2023 10:44:41 +0200 Subject: [PATCH] Handle config --- packages/server/src/api/controllers/datasource.ts | 6 ++---- packages/types/src/documents/app/datasource.ts | 2 +- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/packages/server/src/api/controllers/datasource.ts b/packages/server/src/api/controllers/datasource.ts index 65c910bcc0..686515b293 100644 --- a/packages/server/src/api/controllers/datasource.ts +++ b/packages/server/src/api/controllers/datasource.ts @@ -129,11 +129,9 @@ export async function verify( ) { 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( - _.merge({ config: { auth } }, datasource) - ) + const connector = await getConnector(_.merge(datasource, { config })) if (!connector.testConnection) { ctx.throw(400, "Connection information verification not supported") } diff --git a/packages/types/src/documents/app/datasource.ts b/packages/types/src/documents/app/datasource.ts index 89e7422cb4..8dfdfe6d0f 100644 --- a/packages/types/src/documents/app/datasource.ts +++ b/packages/types/src/documents/app/datasource.ts @@ -9,7 +9,7 @@ export interface Datasource extends Document { // the config is defined by the schema config?: { [key: string]: string | number | boolean | any[] - } & { auth?: object } + } plus?: boolean entities?: { [key: string]: Table