From 9efcea1fc8233b12926affa8d64b6fe807fe2d24 Mon Sep 17 00:00:00 2001 From: shanhexi Date: Sat, 26 Aug 2023 17:35:25 +0800 Subject: [PATCH] fix:Alternate environment interface --- chat2db-client/src/components/ConnectionEdit/index.tsx | 2 +- chat2db-client/src/service/connection.ts | 9 ++++++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/chat2db-client/src/components/ConnectionEdit/index.tsx b/chat2db-client/src/components/ConnectionEdit/index.tsx index 518ab6b6..a0b3e0bb 100644 --- a/chat2db-client/src/components/ConnectionEdit/index.tsx +++ b/chat2db-client/src/components/ConnectionEdit/index.tsx @@ -64,7 +64,7 @@ export default forwardRef(function CreateConnection(props: IProps, ref: Forwarde connectionService.getEnvList().then((res) => { setEnvList(res?.map(t => { return { - value: t.code, + value: t.id, label: t.name } })); diff --git a/chat2db-client/src/service/connection.ts b/chat2db-client/src/service/connection.ts index 3c34b280..59f16cb9 100644 --- a/chat2db-client/src/service/connection.ts +++ b/chat2db-client/src/service/connection.ts @@ -76,7 +76,14 @@ const downloadDriver = createRequest<{ dbType: string }, void>('/api/jdbc/driver const saveDriver = createRequest('/api/jdbc/driver/save', { errorLevel: false, method: 'post' }); -const getEnvList = createRequest('/api/env/list', { errorLevel: false}); +export interface IEnv { + id: string; + name: string; + shortName: string; + style: string; +} + +const getEnvList = createRequest('/api/common/environment/list_all', { errorLevel: false}); export default { getEnvList,