File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed
DBQnA/ui/react/src/components/DbConnect Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -9,7 +9,7 @@ const DBConnect: React.FC = () => {
9
9
const [ formData , setFormData ] = useState ( {
10
10
user : 'postgres' ,
11
11
database : 'chinook' ,
12
- host : '10.223.24.113 ' ,
12
+ host : '127.0.0.1 ' ,
13
13
password : 'testpwd' ,
14
14
port : '5442' ,
15
15
} ) ;
@@ -42,12 +42,13 @@ const DBConnect: React.FC = () => {
42
42
e . preventDefault ( ) ;
43
43
try {
44
44
let api_response : Record < string , any > ;
45
- api_response = await axios . post ( `${ TEXT_TO_SQL_URL } /postgres/health` , formData ) ;
45
+ let unifiedConnData = { "conn_str" :formData } ;
46
+ api_response = await axios . post ( `${ TEXT_TO_SQL_URL } /postgres/health` , unifiedConnData ) ;
46
47
47
48
setSqlStatus ( null ) ;
48
49
setSqlError ( null ) ;
49
50
50
- if ( api_response . data . status === 'success' ) {
51
+ if ( api_response . data . status && api_response . data . status . toLowerCase ( ) . includes ( 'success' ) ) {
51
52
setDbStatus ( api_response . data . message ) ;
52
53
setDbError ( null ) ;
53
54
setIsConnected ( true ) ;
You can’t perform that action at this time.
0 commit comments