Browse Source

fix: handle empty search path when editing connection param or when change is done using json edit (#8573)

pull/8575/head
Pranav C 1 month ago committed by GitHub
parent
commit
ef1997a7fe
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 16
      packages/nc-gui/components/dashboard/settings/data-sources/EditBase.vue

16
packages/nc-gui/components/dashboard/settings/data-sources/EditBase.vue

@ -97,7 +97,8 @@ const validators = computed(() => {
'dataSource.connection.user': [fieldRequiredValidator()],
'dataSource.connection.password': [fieldRequiredValidator()],
'dataSource.connection.database': [fieldRequiredValidator()],
...([ClientType.PG, ClientType.MSSQL].includes(formState.value.dataSource.client)
...([ClientType.PG, ClientType.MSSQL].includes(formState.value.dataSource.client) &&
formState.value.dataSource.searchPath
? {
'dataSource.searchPath.0': [fieldRequiredValidator()],
}
@ -342,6 +343,19 @@ onMounted(async () => {
updateSSLUse()
}
})
// if searchPath is null/undefined reset it to empty array when necessary
watch(
() => formState.value.dataSource.searchPath,
(val) => {
if ([ClientType.PG, ClientType.MSSQL].includes(formState.value.dataSource.client) && !val) {
formState.value.dataSource.searchPath = []
}
},
{
immediate: true,
},
)
</script>
<template>

Loading…
Cancel
Save