Skip to content

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

Fix refresh issues on PKI Inventory table

Carlos Monastyrski9263c1a23d6a
diff --git a/frontend/src/hooks/api/certificates/mutations.tsx b/frontend/src/hooks/api/certificates/mutations.tsx
index a6daf04917..f65d6adc6a 100644
--- a/frontend/src/hooks/api/certificates/mutations.tsx
+++ b/frontend/src/hooks/api/certificates/mutations.tsx
@@ -27,9 +27,18 @@ export const useDeleteCert = () => {
);
return certificate;
},
- onSuccess: (_, { projectSlug }) => {
+ onSuccess: (_, { projectId }) => {
queryClient.invalidateQueries({
- queryKey: projectKeys.forProjectCertificates(projectSlug)
+ queryKey: ["certificate-profiles", "list"]
+ });
+ queryClient.invalidateQueries({
+ queryKey: pkiSubscriberKeys.allPkiSubscriberCertificates()
+ });
+ queryClient.invalidateQueries({
+ queryKey: projectKeys.allProjectCertificates()
+ });
+ queryClient.invalidateQueries({
+ queryKey: projectKeys.forProjectCertificates(projectId)
});
}
});
@@ -49,16 +58,18 @@ export const useRevokeCert = () => {
);
return certificate;
},
- onSuccess: (_, { projectSlug }) => {
+ onSuccess: (_, { projectId }) => {
queryClient.invalidateQueries({
- queryKey: projectKeys.forProjectCertificates(projectSlug)
+ queryKey: ["certificate-profiles", "list"]
});
queryClient.invalidateQueries({
queryKey: pkiSubscriberKeys.allPkiSubscriberCertificates()
});
-
queryClient.invalidateQueries({
- queryKey: ["certificate-profiles", "list"]
+ queryKey: projectKeys.allProjectCertificates()
+ });
+ queryClient.invalidateQueries({
+ queryKey: projectKeys.forProjectCertificates(projectId)
});
}
});
diff --git a/frontend/src/hooks/api/certificates/types.ts b/frontend/src/hooks/api/certificates/types.ts
index 5e950b9c9a..52ac0d9d46 100644
--- a/frontend/src/hooks/api/certificates/types.ts
+++ b/frontend/src/hooks/api/certificates/types.ts
@@ -25,11 +25,13 @@ export type TCertificate = {
export type TDeleteCertDTO = {
projectSlug: string;
+ projectId: string;
serialNumber: string;
};
export type TRevokeCertDTO = {
projectSlug: string;
+ projectId: string;
serialNumber: string;
revocationReason: string;
};
diff --git a/frontend/src/pages/cert-manager/CertificatesPage/components/CertificateRevocationModal.tsx b/frontend/src/pages/cert-manager/CertificatesPage/components/CertificateRevocationModal.tsx
index d9a564fb1d..39198beb81 100644
--- a/frontend/src/pages/cert-manager/CertificatesPage/components/CertificateRevocationModal.tsx
+++ b/frontend/src/pages/cert-manager/CertificatesPage/components/CertificateRevocationModal.tsx
@@ -54,6 +54,7 @@ export const CertificateRevocationModal = ({ popUp, handlePopUpToggle }: Props)
await revokeCertificate({
projectSlug: currentProject.slug,
+ projectId: currentProject.id,
serialNumber,
revocationReason
});
diff --git a/frontend/src/pages/cert-manager/CertificatesPage/components/CertificatesSection.tsx b/frontend/src/pages/cert-manager/CertificatesPage/components/CertificatesSection.tsx
index 7ca9b81d01..1330c5c4a9 100644
--- a/frontend/src/pages/cert-manager/CertificatesPage/components/CertificatesSection.tsx
+++ b/frontend/src/pages/cert-manager/CertificatesPage/components/CertificatesSection.tsx
@@ -42,7 +42,11 @@ export const CertificatesSection = () => {
const onRemoveCertificateSubmit = async (serialNumber: string) => {
if (!currentProject?.slug) return;
- await deleteCert({ serialNumber, projectSlug: currentProject.slug });
+ await deleteCert({
+ serialNumber,
+ projectSlug: currentProject.slug,
+ projectId: currentProject.id
+ });
createNotification({
text: "Successfully deleted certificate",