From 282830e7a2d6714f2caacd4ad53c1d725e974f83 Mon Sep 17 00:00:00 2001 From: Tuan Dang Date: Mon, 4 Dec 2023 16:24:55 +0700 Subject: [PATCH] Fix lint issues --- .../CreateClientSecretModal.tsx | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/frontend/src/views/Org/MembersPage/components/OrgMachineIdentityTab/components/MachineIdentitySection/CreateClientSecretModal.tsx b/frontend/src/views/Org/MembersPage/components/OrgMachineIdentityTab/components/MachineIdentitySection/CreateClientSecretModal.tsx index 65b60ed56..4e3961eab 100644 --- a/frontend/src/views/Org/MembersPage/components/OrgMachineIdentityTab/components/MachineIdentitySection/CreateClientSecretModal.tsx +++ b/frontend/src/views/Org/MembersPage/components/OrgMachineIdentityTab/components/MachineIdentitySection/CreateClientSecretModal.tsx @@ -97,16 +97,15 @@ export const CreateClientSecretModal = ({ }: FormData) => { try { - if (popUpData) { + if (!popUpData?.machineId) return; + + const { clientSecret } = await createClientSecretMutateAsync({ + machineId: popUpData.machineId, + description, + ttl: Number(ttl) + }); - const { clientSecret } = await createClientSecretMutateAsync({ - machineId: popUpData.machineId, - description, - ttl: Number(ttl) - }); - - setToken(clientSecret); - } + setToken(clientSecret); createNotification({ text: "Successfully created client secret",