Skip to content

Infisical is the open-source platform for securing secrets, certificates, access, and AI Agents.

Fix PAM account validation toast scope

bernie-gdeaa57733aed
diff --git a/frontend/src/hooks/api/pam/mutations.tsx b/frontend/src/hooks/api/pam/mutations.tsx
index e259d3c150..b1df4f59ed 100644
--- a/frontend/src/hooks/api/pam/mutations.tsx
+++ b/frontend/src/hooks/api/pam/mutations.tsx
@@ -115,9 +115,10 @@ export const useCreatePamAccount = () => {
});
};
-export const useUpdatePamAccount = () => {
+export const useUpdatePamAccount = ({ skipValidationToast = false } = {}) => {
const queryClient = useQueryClient();
return useMutation({
+ meta: skipValidationToast ? { skipValidationToast: true } : undefined,
mutationFn: async ({ accountId, accountType, ...params }: TUpdatePamAccountDTO) => {
const { data } = await apiRequest.patch(
`/api/v1/pam/accounts/${accountType}/${accountId}`,
diff --git a/frontend/src/pages/pam/PamAccountsPage/components/EditAccountForm.tsx b/frontend/src/pages/pam/PamAccountsPage/components/EditAccountForm.tsx
index 5b809d1ed7..4c35821e5f 100644
--- a/frontend/src/pages/pam/PamAccountsPage/components/EditAccountForm.tsx
+++ b/frontend/src/pages/pam/PamAccountsPage/components/EditAccountForm.tsx
@@ -62,7 +62,7 @@ type Props = {
export const EditAccountForm = ({ accountId, onDirtyChange }: Props) => {
const { data: account, isLoading: isLoadingAccount } = useGetPamAccountById(accountId);
- const updateAccount = useUpdatePamAccount();
+ const updateAccount = useUpdatePamAccount({ skipValidationToast: true });
const { data: accountTypes = [] } = useListPamAccountTypes();
const { data: folders = [] } = useListPamFoldersAdmin();
const { data: templates = [] } = useListPamAccountTemplates(