mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-08 22:28:15 +00:00
Merge pull request #4885 from Infisical/fix/pkiInventoryRefresh
Fix refresh issues on PKI Inventory table
This commit is contained in:
@@ -213,7 +213,7 @@ export const certificateProfileServiceFactory = ({
|
|||||||
throw new NotFoundError({ message: "Project not found" });
|
throw new NotFoundError({ message: "Project not found" });
|
||||||
}
|
}
|
||||||
const plan = await licenseService.getPlan(project.orgId);
|
const plan = await licenseService.getPlan(project.orgId);
|
||||||
if (!plan.pkiAcme) {
|
if (!plan.pkiAcme && data.enrollmentType === EnrollmentType.ACME) {
|
||||||
throw new BadRequestError({
|
throw new BadRequestError({
|
||||||
message: "Failed to create certificate profile: Plan restriction. Upgrade plan to continue"
|
message: "Failed to create certificate profile: Plan restriction. Upgrade plan to continue"
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -27,9 +27,18 @@ export const useDeleteCert = () => {
|
|||||||
);
|
);
|
||||||
return certificate;
|
return certificate;
|
||||||
},
|
},
|
||||||
onSuccess: (_, { projectSlug }) => {
|
onSuccess: (_, { projectId }) => {
|
||||||
queryClient.invalidateQueries({
|
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;
|
return certificate;
|
||||||
},
|
},
|
||||||
onSuccess: (_, { projectSlug }) => {
|
onSuccess: (_, { projectId }) => {
|
||||||
queryClient.invalidateQueries({
|
queryClient.invalidateQueries({
|
||||||
queryKey: projectKeys.forProjectCertificates(projectSlug)
|
queryKey: ["certificate-profiles", "list"]
|
||||||
});
|
});
|
||||||
queryClient.invalidateQueries({
|
queryClient.invalidateQueries({
|
||||||
queryKey: pkiSubscriberKeys.allPkiSubscriberCertificates()
|
queryKey: pkiSubscriberKeys.allPkiSubscriberCertificates()
|
||||||
});
|
});
|
||||||
|
|
||||||
queryClient.invalidateQueries({
|
queryClient.invalidateQueries({
|
||||||
queryKey: ["certificate-profiles", "list"]
|
queryKey: projectKeys.allProjectCertificates()
|
||||||
|
});
|
||||||
|
queryClient.invalidateQueries({
|
||||||
|
queryKey: projectKeys.forProjectCertificates(projectId)
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -24,12 +24,12 @@ export type TCertificate = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
export type TDeleteCertDTO = {
|
export type TDeleteCertDTO = {
|
||||||
projectSlug: string;
|
projectId: string;
|
||||||
serialNumber: string;
|
serialNumber: string;
|
||||||
};
|
};
|
||||||
|
|
||||||
export type TRevokeCertDTO = {
|
export type TRevokeCertDTO = {
|
||||||
projectSlug: string;
|
projectId: string;
|
||||||
serialNumber: string;
|
serialNumber: string;
|
||||||
revocationReason: string;
|
revocationReason: string;
|
||||||
};
|
};
|
||||||
|
|||||||
+1
-1
@@ -53,7 +53,7 @@ export const CertificateRevocationModal = ({ popUp, handlePopUpToggle }: Props)
|
|||||||
const { serialNumber } = popUp.revokeCertificate.data as { serialNumber: string };
|
const { serialNumber } = popUp.revokeCertificate.data as { serialNumber: string };
|
||||||
|
|
||||||
await revokeCertificate({
|
await revokeCertificate({
|
||||||
projectSlug: currentProject.slug,
|
projectId: currentProject.id,
|
||||||
serialNumber,
|
serialNumber,
|
||||||
revocationReason
|
revocationReason
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -42,7 +42,10 @@ export const CertificatesSection = () => {
|
|||||||
const onRemoveCertificateSubmit = async (serialNumber: string) => {
|
const onRemoveCertificateSubmit = async (serialNumber: string) => {
|
||||||
if (!currentProject?.slug) return;
|
if (!currentProject?.slug) return;
|
||||||
|
|
||||||
await deleteCert({ serialNumber, projectSlug: currentProject.slug });
|
await deleteCert({
|
||||||
|
serialNumber,
|
||||||
|
projectId: currentProject.id
|
||||||
|
});
|
||||||
|
|
||||||
createNotification({
|
createNotification({
|
||||||
text: "Successfully deleted certificate",
|
text: "Successfully deleted certificate",
|
||||||
|
|||||||
Reference in New Issue
Block a user