fix: turn on SSL in database edit form show 500 error (#16151)
* fix error for query.update * converrt before making request * fix query params * remove unchanged files * this * update tsconfig
This commit is contained in:
parent
fd80ae34a3
commit
3f86a54ac1
|
|
@ -539,20 +539,10 @@ const DatabaseModal: FunctionComponent<DatabaseModalProps> = ({
|
||||||
const dbToUpdate = JSON.parse(JSON.stringify(update));
|
const dbToUpdate = JSON.parse(JSON.stringify(update));
|
||||||
|
|
||||||
if (dbToUpdate.configuration_method === CONFIGURATION_METHOD.DYNAMIC_FORM) {
|
if (dbToUpdate.configuration_method === CONFIGURATION_METHOD.DYNAMIC_FORM) {
|
||||||
// Validate DB before saving
|
|
||||||
await getValidation(dbToUpdate, true);
|
|
||||||
if (validationErrors && !isEmpty(validationErrors)) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (dbToUpdate?.parameters?.query) {
|
if (dbToUpdate?.parameters?.query) {
|
||||||
// convert query params into dictionary
|
// convert query params into dictionary
|
||||||
dbToUpdate.parameters.query = JSON.parse(
|
const urlParams = new URLSearchParams(dbToUpdate?.parameters?.query);
|
||||||
`{"${decodeURI((dbToUpdate?.parameters?.query as string) || '')
|
dbToUpdate.parameters.query = Object.fromEntries(urlParams);
|
||||||
.replace(/"/g, '\\"')
|
|
||||||
.replace(/&/g, '","')
|
|
||||||
.replace(/=/g, '":"')}"}`,
|
|
||||||
);
|
|
||||||
} else if (
|
} else if (
|
||||||
dbToUpdate?.parameters?.query === '' &&
|
dbToUpdate?.parameters?.query === '' &&
|
||||||
'query' in dbModel.parameters.properties
|
'query' in dbModel.parameters.properties
|
||||||
|
|
@ -560,6 +550,12 @@ const DatabaseModal: FunctionComponent<DatabaseModalProps> = ({
|
||||||
dbToUpdate.parameters.query = {};
|
dbToUpdate.parameters.query = {};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Validate DB before saving
|
||||||
|
await getValidation(dbToUpdate, true);
|
||||||
|
if (validationErrors && !isEmpty(validationErrors)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
const engine = dbToUpdate.backend || dbToUpdate.engine;
|
const engine = dbToUpdate.backend || dbToUpdate.engine;
|
||||||
if (engine === 'bigquery' && dbToUpdate.parameters?.credentials_info) {
|
if (engine === 'bigquery' && dbToUpdate.parameters?.credentials_info) {
|
||||||
// wrap encrypted_extra in credentials_info only for BigQuery
|
// wrap encrypted_extra in credentials_info only for BigQuery
|
||||||
|
|
|
||||||
|
|
@ -7,7 +7,7 @@
|
||||||
"forceConsistentCasingInFileNames": true,
|
"forceConsistentCasingInFileNames": true,
|
||||||
"importHelpers": false,
|
"importHelpers": false,
|
||||||
"jsx": "preserve",
|
"jsx": "preserve",
|
||||||
"lib": ["dom", "esnext"],
|
"lib": ["dom", "dom.iterable", "esnext"],
|
||||||
"module": "esnext",
|
"module": "esnext",
|
||||||
"moduleResolution": "node",
|
"moduleResolution": "node",
|
||||||
"noImplicitAny": true,
|
"noImplicitAny": true,
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue