fix:Alternate environment interface

This commit is contained in:
shanhexi
2023-08-26 17:35:25 +08:00
parent a38a1f9e61
commit 9efcea1fc8
2 changed files with 9 additions and 2 deletions

View File

@@ -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
}
}));

View File

@@ -76,7 +76,14 @@ const downloadDriver = createRequest<{ dbType: string }, void>('/api/jdbc/driver
const saveDriver = createRequest<IUploadDriver, void>('/api/jdbc/driver/save', { errorLevel: false, method: 'post' });
const getEnvList = createRequest<void, {code:string, name:string}[]>('/api/env/list', { errorLevel: false});
export interface IEnv {
id: string;
name: string;
shortName: string;
style: string;
}
const getEnvList = createRequest<void, IEnv[]>('/api/common/environment/list_all', { errorLevel: false});
export default {
getEnvList,