forked from phoenix/litellm-mirror
fix deleting a key on ui
This commit is contained in:
parent
79be7239a2
commit
4795fced10
1 changed files with 9 additions and 3 deletions
|
@ -299,13 +299,19 @@ const handleEditSubmit = async (formValues: Record<string, any>) => {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
const handleDelete = async (token: string) => {
|
const handleDelete = async (token: any) => {
|
||||||
|
console.log("handleDelete:", token);
|
||||||
|
if (token.token == null) {
|
||||||
|
if (token.token_id !== null) {
|
||||||
|
token.token = token.token_id;
|
||||||
|
}
|
||||||
|
}
|
||||||
if (data == null) {
|
if (data == null) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Set the key to delete and open the confirmation modal
|
// Set the key to delete and open the confirmation modal
|
||||||
setKeyToDelete(token);
|
setKeyToDelete(token.token);
|
||||||
localStorage.removeItem("userData" + userID);
|
localStorage.removeItem("userData" + userID);
|
||||||
setIsDeleteModalOpen(true);
|
setIsDeleteModalOpen(true);
|
||||||
};
|
};
|
||||||
|
@ -597,7 +603,7 @@ const handleEditSubmit = async (formValues: Record<string, any>) => {
|
||||||
onClick={() => handleEditClick(item)}
|
onClick={() => handleEditClick(item)}
|
||||||
/>
|
/>
|
||||||
<Icon
|
<Icon
|
||||||
onClick={() => handleDelete(item.token)}
|
onClick={() => handleDelete(item)}
|
||||||
icon={TrashIcon}
|
icon={TrashIcon}
|
||||||
size="sm"
|
size="sm"
|
||||||
/>
|
/>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue