Fix to ensure only the budibase datasource type is altered on save
This commit is contained in:
parent
d6e88ae6b4
commit
2de437aaa7
|
@ -153,7 +153,9 @@ export async function update(ctx: BBContext) {
|
||||||
const auth = datasource.config.auth
|
const auth = datasource.config.auth
|
||||||
await invalidateVariables(datasource, ctx.request.body)
|
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 }
|
? { name: ctx.request.body?.name }
|
||||||
: ctx.request.body
|
: ctx.request.body
|
||||||
|
|
||||||
|
@ -168,7 +170,7 @@ export async function update(ctx: BBContext) {
|
||||||
datasource._rev = response.rev
|
datasource._rev = response.rev
|
||||||
|
|
||||||
// Drain connection pools when configuration is changed
|
// Drain connection pools when configuration is changed
|
||||||
if (datasource.source && datasource.plus) {
|
if (datasource.source && !isBudibaseSource) {
|
||||||
const source = await getIntegration(datasource.source)
|
const source = await getIntegration(datasource.source)
|
||||||
if (source && source.pool) {
|
if (source && source.pool) {
|
||||||
await source.pool.end()
|
await source.pool.end()
|
||||||
|
|
Loading…
Reference in New Issue