Fixes for feedback in PR

pull/2277/head
Agusti Fernandez Pardo 2022-04-13 15:47:15 +02:00
parent 84cafcb5a0
commit 35c46551ee
4 changed files with 14 additions and 8 deletions

@ -1 +1 @@
Subproject commit a064983002b2b6dd288788c87eb8b218063af377
Subproject commit 557342104b78b2cd72f5a078f5eb8f5c47f2b43d

View File

@ -104,11 +104,16 @@ export default function ApiKeyDialogForm(props: {
<Form
form={form}
handleSubmit={async (event) => {
const newApiKey = await utils.client.mutation("viewer.apiKeys.create", event);
setNewApiKey(newApiKey);
setNewApiKeyDetails({ ...event });
await utils.invalidateQueries(["viewer.apiKeys.list"]);
setSuccessfulNewApiKeyModal(true);
try {
const newApiKey = await utils.client.mutation("viewer.apiKeys.create", event);
setNewApiKey(newApiKey);
setNewApiKeyDetails({ ...event });
await utils.invalidateQueries(["viewer.apiKeys.list"]);
setSuccessfulNewApiKeyModal(true);
} catch (error: any) {
console.log(error);
showToast(error.message, "error");
}
}}
className="space-y-4">
<div className=" mb-10 mt-1">

View File

@ -70,7 +70,8 @@ export default function ApiKeyListItem(props: { apiKey: TApiKeys; onEditApiKey:
color="minimal"
size="icon"
StartIcon={PencilAltIcon}
className="ml-4 w-full self-center p-2"></Button>
className="ml-4 w-full self-center p-2"
/>
</Tooltip>
<Dialog>
<Tooltip content={t("delete_api_key")}>

@ -1 +1 @@
Subproject commit b1b8ffda83a94760ab6763e02276c730c46a35fd
Subproject commit 3df94a7d46c3b75c0f9ca67a3dd42ec3776fa539