mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-09-22 13:39:35 +00:00
feat: resolved backend ts issues
This commit is contained in:
@@ -245,7 +245,9 @@ export const useUpdateProject = () => {
|
||||
newSlug,
|
||||
secretSharing,
|
||||
showSnapshotsLegacy,
|
||||
secretDetectionIgnoreValues
|
||||
secretDetectionIgnoreValues,
|
||||
autoCapitalization,
|
||||
pitVersionLimit
|
||||
}) => {
|
||||
const { data } = await apiRequest.patch<{ project: Project }>(
|
||||
`/api/v1/projects/${projectID}`,
|
||||
@@ -255,7 +257,9 @@ export const useUpdateProject = () => {
|
||||
slug: newSlug,
|
||||
secretSharing,
|
||||
showSnapshotsLegacy,
|
||||
secretDetectionIgnoreValues
|
||||
secretDetectionIgnoreValues,
|
||||
autoCapitalization,
|
||||
pitVersionLimit
|
||||
}
|
||||
);
|
||||
return data.project;
|
||||
@@ -682,15 +686,15 @@ export const useListWorkspaceGroups = (projectId: string) => {
|
||||
};
|
||||
|
||||
export const useListWorkspaceCas = ({
|
||||
projectSlug,
|
||||
projectId,
|
||||
status
|
||||
}: {
|
||||
projectSlug: string;
|
||||
projectId: string;
|
||||
status?: CaStatus;
|
||||
}) => {
|
||||
return useQuery({
|
||||
queryKey: projectKeys.specificWorkspaceCas({
|
||||
projectSlug,
|
||||
projectId,
|
||||
status
|
||||
}),
|
||||
queryFn: async () => {
|
||||
@@ -701,29 +705,29 @@ export const useListWorkspaceCas = ({
|
||||
const {
|
||||
data: { cas }
|
||||
} = await apiRequest.get<{ cas: TCertificateAuthority[] }>(
|
||||
`/api/v1/projects/${projectSlug}/cas`,
|
||||
`/api/v1/projects/${projectId}/cas`,
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
return cas;
|
||||
},
|
||||
enabled: Boolean(projectSlug)
|
||||
enabled: Boolean(projectId)
|
||||
});
|
||||
};
|
||||
|
||||
export const useListWorkspaceCertificates = ({
|
||||
projectSlug,
|
||||
projectId,
|
||||
offset,
|
||||
limit
|
||||
}: {
|
||||
projectSlug: string;
|
||||
projectId: string;
|
||||
offset: number;
|
||||
limit: number;
|
||||
}) => {
|
||||
return useQuery({
|
||||
queryKey: projectKeys.specificWorkspaceCertificates({
|
||||
slug: projectSlug,
|
||||
projectId,
|
||||
offset,
|
||||
limit
|
||||
}),
|
||||
@@ -736,7 +740,7 @@ export const useListWorkspaceCertificates = ({
|
||||
const {
|
||||
data: { certificates, totalCount }
|
||||
} = await apiRequest.get<{ certificates: TCertificate[]; totalCount: number }>(
|
||||
`/api/v1/projects/${projectSlug}/certificates`,
|
||||
`/api/v1/projects/${projectId}/certificates`,
|
||||
{
|
||||
params
|
||||
}
|
||||
@@ -744,7 +748,7 @@ export const useListWorkspaceCertificates = ({
|
||||
|
||||
return { certificates, totalCount };
|
||||
},
|
||||
enabled: Boolean(projectSlug)
|
||||
enabled: Boolean(projectId)
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
@@ -34,22 +34,22 @@ export const projectKeys = {
|
||||
getWorkspaceGroupMemberships: (projectId: string) => [{ projectId }, "project-groups"] as const,
|
||||
getWorkspaceGroupMembershipDetails: (projectId: string, groupId: string) =>
|
||||
[{ projectId, groupId }, "project-group-membership-details"] as const,
|
||||
getWorkspaceCas: ({ projectSlug }: { projectSlug: string }) =>
|
||||
[{ projectSlug }, "project-cas"] as const,
|
||||
specificWorkspaceCas: ({ projectSlug, status }: { projectSlug: string; status?: CaStatus }) =>
|
||||
[...projectKeys.getWorkspaceCas({ projectSlug }), { status }] as const,
|
||||
getWorkspaceCas: ({ projectId }: { projectId: string }) =>
|
||||
[{ projectId }, "project-cas"] as const,
|
||||
specificWorkspaceCas: ({ projectId, status }: { projectId: string; status?: CaStatus }) =>
|
||||
[...projectKeys.getWorkspaceCas({ projectId }), { status }] as const,
|
||||
allWorkspaceCertificates: () => ["project-certificates"] as const,
|
||||
forWorkspaceCertificates: (slug: string) =>
|
||||
[...projectKeys.allWorkspaceCertificates(), slug] as const,
|
||||
forWorkspaceCertificates: (projectId: string) =>
|
||||
[...projectKeys.allWorkspaceCertificates(), projectId] as const,
|
||||
specificWorkspaceCertificates: ({
|
||||
slug,
|
||||
projectId,
|
||||
offset,
|
||||
limit
|
||||
}: {
|
||||
slug: string;
|
||||
projectId: string;
|
||||
offset: number;
|
||||
limit: number;
|
||||
}) => [...projectKeys.forWorkspaceCertificates(slug), { offset, limit }] as const,
|
||||
}) => [...projectKeys.forWorkspaceCertificates(projectId), { offset, limit }] as const,
|
||||
getWorkspacePkiAlerts: (projectId: string) => [{ projectId }, "project-pki-alerts"] as const,
|
||||
getWorkspacePkiSubscribers: (projectId: string) =>
|
||||
[{ projectId }, "project-pki-subscribers"] as const,
|
||||
|
||||
@@ -83,6 +83,8 @@ export type UpdateProjectDTO = {
|
||||
secretSharing?: boolean;
|
||||
showSnapshotsLegacy?: boolean;
|
||||
secretDetectionIgnoreValues?: string[];
|
||||
pitVersionLimit?: number;
|
||||
autoCapitalization?: boolean;
|
||||
};
|
||||
|
||||
export type UpdatePitVersionLimitDTO = { projectSlug: string; pitVersionLimit: number };
|
||||
|
||||
@@ -64,7 +64,7 @@ export const CertificatesTable = ({ handlePopUpOpen }: Props) => {
|
||||
|
||||
const { currentWorkspace } = useWorkspace();
|
||||
const { data, isPending } = useListWorkspaceCertificates({
|
||||
projectSlug: currentWorkspace?.slug ?? "",
|
||||
projectId: currentWorkspace?.slug ?? "",
|
||||
offset: (page - 1) * perPage,
|
||||
limit: perPage
|
||||
});
|
||||
|
||||
@@ -49,7 +49,7 @@ export const AddPkiCollectionItemModal = ({
|
||||
});
|
||||
|
||||
const { data } = useListWorkspaceCertificates({
|
||||
projectSlug: currentWorkspace?.slug || "",
|
||||
projectId: currentWorkspace?.slug || "",
|
||||
offset: 0,
|
||||
limit: 25
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user