mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-09-22 13:39:35 +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" });
|
||||
}
|
||||
const plan = await licenseService.getPlan(project.orgId);
|
||||
if (!plan.pkiAcme) {
|
||||
if (!plan.pkiAcme && data.enrollmentType === EnrollmentType.ACME) {
|
||||
throw new BadRequestError({
|
||||
message: "Failed to create certificate profile: Plan restriction. Upgrade plan to continue"
|
||||
});
|
||||
|
||||
@@ -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)
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
@@ -24,12 +24,12 @@ export type TCertificate = {
|
||||
};
|
||||
|
||||
export type TDeleteCertDTO = {
|
||||
projectSlug: string;
|
||||
projectId: string;
|
||||
serialNumber: string;
|
||||
};
|
||||
|
||||
export type TRevokeCertDTO = {
|
||||
projectSlug: string;
|
||||
projectId: string;
|
||||
serialNumber: string;
|
||||
revocationReason: string;
|
||||
};
|
||||
|
||||
@@ -53,7 +53,7 @@ export const CertificateRevocationModal = ({ popUp, handlePopUpToggle }: Props)
|
||||
const { serialNumber } = popUp.revokeCertificate.data as { serialNumber: string };
|
||||
|
||||
await revokeCertificate({
|
||||
projectSlug: currentProject.slug,
|
||||
projectId: currentProject.id,
|
||||
serialNumber,
|
||||
revocationReason
|
||||
});
|
||||
|
||||
@@ -42,7 +42,10 @@ export const CertificatesSection = () => {
|
||||
const onRemoveCertificateSubmit = async (serialNumber: string) => {
|
||||
if (!currentProject?.slug) return;
|
||||
|
||||
await deleteCert({ serialNumber, projectSlug: currentProject.slug });
|
||||
await deleteCert({
|
||||
serialNumber,
|
||||
projectId: currentProject.id
|
||||
});
|
||||
|
||||
createNotification({
|
||||
text: "Successfully deleted certificate",
|
||||
|
||||
Reference in New Issue
Block a user