From 2de437aaa710d7a13e8491a28fef83e5d862bd8c Mon Sep 17 00:00:00 2001 From: Dean Date: Tue, 29 Nov 2022 16:08:31 +0000 Subject: [PATCH] Fix to ensure only the budibase datasource type is altered on save --- packages/server/src/api/controllers/datasource.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/packages/server/src/api/controllers/datasource.ts b/packages/server/src/api/controllers/datasource.ts index cb1eb9ccaf..d47629ed3e 100644 --- a/packages/server/src/api/controllers/datasource.ts +++ b/packages/server/src/api/controllers/datasource.ts @@ -153,7 +153,9 @@ export async function update(ctx: BBContext) { const auth = datasource.config.auth await invalidateVariables(datasource, ctx.request.body) - const dataSourceBody = !datasource.plus + const isBudibaseSource = datasource.type === dbCore.BUDIBASE_DATASOURCE_TYPE + + const dataSourceBody = isBudibaseSource ? { name: ctx.request.body?.name } : ctx.request.body @@ -168,7 +170,7 @@ export async function update(ctx: BBContext) { datasource._rev = response.rev // Drain connection pools when configuration is changed - if (datasource.source && datasource.plus) { + if (datasource.source && !isBudibaseSource) { const source = await getIntegration(datasource.source) if (source && source.pool) { await source.pool.end()