@@ -27,13 +27,15 @@ interface KeyInfoViewProps {
2727 keyId : string ;
2828 onClose : ( ) => void ;
2929 keyData : KeyResponse | undefined ;
30+ onKeyDataUpdate ?: ( data : Partial < KeyResponse > ) => void ;
31+ onDelete ?: ( ) => void ;
3032 accessToken : string | null ;
3133 userID : string | null ;
3234 userRole : string | null ;
3335 teams : any [ ] | null ;
3436}
3537
36- export default function KeyInfoView ( { keyId, onClose, keyData, accessToken, userID, userRole, teams } : KeyInfoViewProps ) {
38+ export default function KeyInfoView ( { keyId, onClose, keyData, accessToken, userID, userRole, teams, onKeyDataUpdate , onDelete } : KeyInfoViewProps ) {
3739 const [ isEditing , setIsEditing ] = useState ( false ) ;
3840 const [ form ] = Form . useForm ( ) ;
3941 const [ isDeleteModalOpen , setIsDeleteModalOpen ] = useState ( false ) ;
@@ -93,6 +95,9 @@ export default function KeyInfoView({ keyId, onClose, keyData, accessToken, user
9395 }
9496
9597 const newKeyValues = await keyUpdateCall ( accessToken , formValues ) ;
98+ if ( onKeyDataUpdate ) {
99+ onKeyDataUpdate ( newKeyValues )
100+ }
96101 message . success ( "Key updated successfully" ) ;
97102 setIsEditing ( false ) ;
98103 // Refresh key data here if needed
@@ -107,6 +112,9 @@ export default function KeyInfoView({ keyId, onClose, keyData, accessToken, user
107112 if ( ! accessToken ) return ;
108113 await keyDeleteCall ( accessToken as string , keyData . token ) ;
109114 message . success ( "Key deleted successfully" ) ;
115+ if ( onDelete ) {
116+ onDelete ( )
117+ }
110118 onClose ( ) ;
111119 } catch ( error ) {
112120 console . error ( "Error deleting the key:" , error ) ;
0 commit comments