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 = () => {
99 const [ formData , setFormData ] = useState ( {
1010 user : 'postgres' ,
1111 database : 'chinook' ,
12- host : '10.223.24.113 ' ,
12+ host : '127.0.0.1 ' ,
1313 password : 'testpwd' ,
1414 port : '5442' ,
1515 } ) ;
@@ -42,12 +42,13 @@ const DBConnect: React.FC = () => {
4242 e . preventDefault ( ) ;
4343 try {
4444 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 ) ;
4647
4748 setSqlStatus ( null ) ;
4849 setSqlError ( null ) ;
4950
50- if ( api_response . data . status === 'success' ) {
51+ if ( api_response . data . status && api_response . data . status . toLowerCase ( ) . includes ( 'success' ) ) {
5152 setDbStatus ( api_response . data . message ) ;
5253 setDbError ( null ) ;
5354 setIsConnected ( true ) ;
You can’t perform that action at this time.
0 commit comments