Skip to content

DBQnA: Unified POST data format, and fix judgment logic. #2153

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Aug 11, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions DBQnA/ui/react/src/components/DbConnect/DBConnect.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ const DBConnect: React.FC = () => {
const [formData, setFormData] = useState({
user: 'postgres',
database: 'chinook',
host: '10.223.24.113',
host: '127.0.0.1',
password: 'testpwd',
port: '5442',
});
Expand Down Expand Up @@ -42,12 +42,13 @@ const DBConnect: React.FC = () => {
e.preventDefault();
try {
let api_response: Record<string, any>;
api_response = await axios.post(`${TEXT_TO_SQL_URL}/postgres/health`, formData);
let unifiedConnData = {"conn_str":formData};
api_response = await axios.post(`${TEXT_TO_SQL_URL}/postgres/health`, unifiedConnData);

setSqlStatus(null);
setSqlError(null);

if (api_response.data.status === 'success') {
if (api_response.data.status && api_response.data.status.toLowerCase().includes('success')) {
setDbStatus(api_response.data.message);
setDbError(null);
setIsConnected(true);
Expand Down