mirror of
https://github.com/nocodb/nocodb.git
synced 2026-05-03 04:36:53 +00:00
fix: handle empty search path when editing connection param or when change is done using json edit (#8573)
This commit is contained in:
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user