Merge pull request #2822 from BerriAI/litellm_ui_fix_edit_key

FIXED -  ui edit keys bug (Edit did not work for a pre-existing key)
This commit is contained in:
Ishaan Jaff 2024-04-03 18:25:28 -07:00 committed by GitHub
commit d36814104c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -63,6 +63,7 @@ interface ItemData {
tpm_limit: string | null;
rpm_limit: string | null;
token: string;
token_id: string | null;
id: number;
team_id: string;
metadata: any;
@ -215,9 +216,12 @@ const ViewKeyTable: React.FC<ViewKeyTableProps> = ({
console.log("handleEditClick:", token);
// set token.token to token.token_id if token_id is not null
if (token.token_id !== null) {
token.token = token.token_id;
if (token.token == null) {
if (token.token_id !== null) {
token.token = token.token_id;
}
}
setSelectedToken(token);
setEditModalVisible(true);
};