Merge pull request #10831 from Budibase/fix/save-rest-connector
Fix/save rest connector
This commit is contained in:
commit
158dfae2db
|
@ -37,7 +37,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
async function saveDatasource() {
|
async function saveDatasource() {
|
||||||
if (integration.features[DatasourceFeature.CONNECTION_CHECKING]) {
|
if (integration.features?.[DatasourceFeature.CONNECTION_CHECKING]) {
|
||||||
const valid = await validateConfig()
|
const valid = await validateConfig()
|
||||||
if (!valid) {
|
if (!valid) {
|
||||||
return false
|
return false
|
||||||
|
|
|
@ -65,7 +65,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
const saveDatasource = async () => {
|
const saveDatasource = async () => {
|
||||||
if (integration.features[DatasourceFeature.CONNECTION_CHECKING]) {
|
if (integration.features?.[DatasourceFeature.CONNECTION_CHECKING]) {
|
||||||
const valid = await validateConfig()
|
const valid = await validateConfig()
|
||||||
if (!valid) {
|
if (!valid) {
|
||||||
return false
|
return false
|
||||||
|
|
|
@ -135,7 +135,7 @@ export function mergeConfigs(update: Datasource, old: Datasource) {
|
||||||
// specific to REST datasources, fix the auth configs again if required
|
// specific to REST datasources, fix the auth configs again if required
|
||||||
if (hasAuthConfigs(update)) {
|
if (hasAuthConfigs(update)) {
|
||||||
const configs = update.config.authConfigs as RestAuthConfig[]
|
const configs = update.config.authConfigs as RestAuthConfig[]
|
||||||
const oldConfigs = old.config?.authConfigs as RestAuthConfig[]
|
const oldConfigs = old.config?.authConfigs as RestAuthConfig[] || []
|
||||||
for (let config of configs) {
|
for (let config of configs) {
|
||||||
if (config.type !== RestAuthType.BASIC) {
|
if (config.type !== RestAuthType.BASIC) {
|
||||||
continue
|
continue
|
||||||
|
|
Loading…
Reference in New Issue