Skip to content

Commit 4377e89

Browse files
committed
fix: bug
1 parent 88fd4d8 commit 4377e89

2 files changed

Lines changed: 6 additions & 3 deletions

File tree

chat2db-client/src/components/ConsoleEditor/components/SelectBoundInfo/index.tsx

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,9 @@ const SelectBoundInfo = memo((props: IProps) => {
105105

106106
// 获取数据库列表
107107
const getDatabaseList = () => {
108+
if(boundInfo.dataSourceId === undefined || boundInfo.dataSourceId === null){
109+
return
110+
}
108111
connectionService
109112
.getDatabaseList({
110113
dataSourceId: boundInfo.dataSourceId,
@@ -131,8 +134,8 @@ const SelectBoundInfo = memo((props: IProps) => {
131134

132135
// 获取schema列表
133136
const getSchemaList = () => {
134-
if (boundInfo.databaseName === null || boundInfo.databaseName === undefined) {
135-
return;
137+
if(boundInfo.dataSourceId === undefined || boundInfo.dataSourceId === null){
138+
return
136139
}
137140
connectionService
138141
.getSchemaList({

chat2db-client/src/service/connection.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ const getDatabaseList = createRequest<{ dataSourceId: number; refresh?: boolean
5959
method: 'get',
6060
});
6161

62-
const getSchemaList = createRequest<{ dataSourceId: number; databaseName: string; refresh?: boolean }, any>(
62+
const getSchemaList = createRequest<{ dataSourceId: number; databaseName?: string; refresh?: boolean }, any>(
6363
'/api/rdb/schema/list',
6464
{ method: 'get' },
6565
);

0 commit comments

Comments
 (0)