fix rename editing
parent
b3c33b3392
commit
62aa37d51c
|
@ -18,7 +18,7 @@ export default function ApiKeyListContainer() {
|
||||||
|
|
||||||
const [newApiKeyModal, setNewApiKeyModal] = useState(false);
|
const [newApiKeyModal, setNewApiKeyModal] = useState(false);
|
||||||
const [editModalOpen, setEditModalOpen] = useState(false);
|
const [editModalOpen, setEditModalOpen] = useState(false);
|
||||||
const [editing, setEditing] = useState<TApiKeys | null>(null);
|
const [apiKeyToEdit, setApiKeyToEdit] = useState<TApiKeys | null>(null);
|
||||||
return (
|
return (
|
||||||
<QueryCell
|
<QueryCell
|
||||||
query={query}
|
query={query}
|
||||||
|
@ -43,7 +43,7 @@ export default function ApiKeyListContainer() {
|
||||||
key={item.id}
|
key={item.id}
|
||||||
apiKey={item}
|
apiKey={item}
|
||||||
onEditApiKey={() => {
|
onEditApiKey={() => {
|
||||||
setEditing(item);
|
setApiKeyToEdit(item);
|
||||||
setEditModalOpen(true);
|
setEditModalOpen(true);
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
|
@ -60,12 +60,12 @@ export default function ApiKeyListContainer() {
|
||||||
{/* Edit api key dialog */}
|
{/* Edit api key dialog */}
|
||||||
<Dialog open={editModalOpen} onOpenChange={(isOpen) => !isOpen && setEditModalOpen(false)}>
|
<Dialog open={editModalOpen} onOpenChange={(isOpen) => !isOpen && setEditModalOpen(false)}>
|
||||||
<DialogContent>
|
<DialogContent>
|
||||||
{editing && (
|
{apiKeyToEdit && (
|
||||||
<ApiKeyDialogForm
|
<ApiKeyDialogForm
|
||||||
title={t("edit_api_key")}
|
title={t("edit_api_key")}
|
||||||
key={editing.id}
|
key={apiKeyToEdit.id}
|
||||||
handleClose={() => setEditModalOpen(false)}
|
handleClose={() => setEditModalOpen(false)}
|
||||||
defaultValues={editing}
|
defaultValues={apiKeyToEdit}
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
</DialogContent>
|
</DialogContent>
|
||||||
|
|
Loading…
Reference in New Issue