diff --git a/frontend/libs/console/legacy-ce/src/lib/features/ConnectDBRedesign/components/ConnectPostgresWidget/utils/generateRequests.ts b/frontend/libs/console/legacy-ce/src/lib/features/ConnectDBRedesign/components/ConnectPostgresWidget/utils/generateRequests.ts index 7ee1bccbb37..5ca2b8dc46a 100644 --- a/frontend/libs/console/legacy-ce/src/lib/features/ConnectDBRedesign/components/ConnectPostgresWidget/utils/generateRequests.ts +++ b/frontend/libs/console/legacy-ce/src/lib/features/ConnectDBRedesign/components/ConnectPostgresWidget/utils/generateRequests.ts @@ -5,46 +5,46 @@ import { cleanEmpty } from './helpers'; export const generateConnectionInfo = ( values: PostgresConnectionSchema['configuration']['connectionInfo'] -) => { - return { - database_url: - values.databaseUrl.connectionType === 'databaseUrl' - ? values.databaseUrl.url - : values.databaseUrl.connectionType === 'envVar' - ? { from_env: values.databaseUrl.envVar } - : { +) => ({ + database_url: + values.databaseUrl.connectionType === 'databaseUrl' + ? values.databaseUrl.url + : values.databaseUrl.connectionType === 'envVar' + ? { from_env: values.databaseUrl.envVar } + : { + connection_parameters: { username: values.databaseUrl.username, password: values.databaseUrl.password, database: values.databaseUrl.database, port: values.databaseUrl.port, host: values.databaseUrl.host, }, - pool_settings: { - total_max_connections: values.poolSettings?.totalMaxConnections, - idle_timeout: values.poolSettings?.idleTimeout, - retries: values.poolSettings?.retries, - pool_timeout: values.poolSettings?.poolTimeout, - connection_lifetime: values.poolSettings?.connectionLifetime, + }, + pool_settings: { + total_max_connections: values.poolSettings?.totalMaxConnections, + idle_timeout: values.poolSettings?.idleTimeout, + retries: values.poolSettings?.retries, + pool_timeout: values.poolSettings?.poolTimeout, + connection_lifetime: values.poolSettings?.connectionLifetime, + }, + use_prepared_statements: values.usePreparedStatements, + isolation_level: values.isolationLevel, + ssl_configuration: { + sslmode: values.sslSettings?.sslMode, + sslrootcert: { + from_env: values.sslSettings?.sslRootCert, }, - use_prepared_statements: values.usePreparedStatements, - isolation_level: values.isolationLevel, - ssl_configuration: { - sslmode: values.sslSettings?.sslMode, - sslrootcert: { - from_env: values.sslSettings?.sslRootCert, - }, - sslcert: { - from_env: values.sslSettings?.sslCert, - }, - sslkey: { - from_env: values.sslSettings?.sslKey, - }, - sslpassword: { - from_env: values.sslSettings?.sslPassword, - }, + sslcert: { + from_env: values.sslSettings?.sslCert, }, - }; -}; + sslkey: { + from_env: values.sslSettings?.sslKey, + }, + sslpassword: { + from_env: values.sslSettings?.sslPassword, + }, + }, +}); export const generatePostgresRequestPayload = ({ driver,