@@ -15,7 +15,7 @@ import LoadingGracile from '@/components/Loading/LoadingGracile';
1515import Driver from './components/Driver' ;
1616
1717// ----- store -----
18- import { useConnectionStore } from '@/pages/main/store/connection' ;
18+ import { useConnectionStore , getConnectionList } from '@/pages/main/store/connection' ;
1919
2020const { Option } = Select ;
2121
@@ -30,7 +30,6 @@ export enum submitType {
3030interface IProps {
3131 closeCreateConnection : ( ) => void ;
3232 connectionData : IConnectionDetails ;
33- submitCallback ?: any ;
3433 submit ?: ( data : IConnectionDetails ) => Promise < any > ;
3534}
3635
@@ -39,7 +38,7 @@ export interface ICreateConnectionFunction {
3938}
4039
4140const ConnectionEdit = forwardRef ( ( props : IProps , ref : ForwardedRef < ICreateConnectionFunction > ) => {
42- const { closeCreateConnection, submitCallback , connectionData, submit } = props ;
41+ const { closeCreateConnection, connectionData, submit } = props ;
4342 const [ baseInfoForm ] = Form . useForm ( ) ;
4443 const [ sshForm ] = Form . useForm ( ) ;
4544 const [ driveData , setDriveData ] = useState < any > ( { } ) ;
@@ -200,7 +199,6 @@ const ConnectionEdit = forwardRef((props: IProps, ref: ForwardedRef<ICreateConne
200199 }
201200
202201 const api : any = connectionService [ type ] ( p ) ;
203-
204202 api
205203 . then ( ( res : any ) => {
206204 if ( type === submitType . TEST ) {
@@ -216,13 +214,13 @@ const ConnectionEdit = forwardRef((props: IProps, ref: ForwardedRef<ICreateConne
216214 : i18n ( 'common.message.addedSuccessfully' ) ,
217215 ) ;
218216
219- setBackfillData ( {
220- ...backfillData ,
221- id : res ,
222- } ) ;
223-
217+ getConnectionList ( ) ;
218+
224219 if ( type === submitType . SAVE ) {
225- submitCallback ?.( ) ;
220+ setBackfillData ( {
221+ ...backfillData ,
222+ id : res ,
223+ } ) ;
226224 }
227225 }
228226 } )
0 commit comments