mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-16 19:28:35 +00:00
misc: addressed PR feedback regarding audit logs and endpoint structure
This commit is contained in:
@@ -15,9 +15,7 @@ export const useCreateCertTemplate = () => {
|
||||
const queryClient = useQueryClient();
|
||||
return useMutation<TCertificateTemplate, {}, TCreateCertificateTemplateDTO>({
|
||||
mutationFn: async (data) => {
|
||||
const {
|
||||
data: { certificateTemplate }
|
||||
} = await apiRequest.post<{ certificateTemplate: TCertificateTemplate }>(
|
||||
const { data: certificateTemplate } = await apiRequest.post<TCertificateTemplate>(
|
||||
"/api/v1/pki/certificate-templates",
|
||||
data
|
||||
);
|
||||
@@ -33,9 +31,7 @@ export const useUpdateCertTemplate = () => {
|
||||
const queryClient = useQueryClient();
|
||||
return useMutation<TCertificateTemplate, {}, TUpdateCertificateTemplateDTO>({
|
||||
mutationFn: async (data) => {
|
||||
const {
|
||||
data: { certificateTemplate }
|
||||
} = await apiRequest.patch<{ certificateTemplate: TCertificateTemplate }>(
|
||||
const { data: certificateTemplate } = await apiRequest.patch<TCertificateTemplate>(
|
||||
`/api/v1/pki/certificate-templates/${data.id}`,
|
||||
data
|
||||
);
|
||||
|
||||
@@ -12,9 +12,7 @@ export const useGetCertTemplate = (id: string) => {
|
||||
return useQuery({
|
||||
queryKey: certTemplateKeys.getCertTemplateById(id),
|
||||
queryFn: async () => {
|
||||
const {
|
||||
data: { certificateTemplate }
|
||||
} = await apiRequest.get<{ certificateTemplate: TCertificateTemplate }>(
|
||||
const { data: certificateTemplate } = await apiRequest.get<TCertificateTemplate>(
|
||||
`/api/v1/pki/certificate-templates/${id}`
|
||||
);
|
||||
return certificateTemplate;
|
||||
|
||||
@@ -1,13 +1,8 @@
|
||||
export type TCertificateTemplateListEntry = {
|
||||
id: string;
|
||||
name: string;
|
||||
caName: string;
|
||||
caId: string;
|
||||
};
|
||||
|
||||
export type TCertificateTemplate = {
|
||||
id: string;
|
||||
caId: string;
|
||||
caName: string;
|
||||
projectId: string;
|
||||
pkiCollectionId?: string;
|
||||
name: string;
|
||||
commonName: string;
|
||||
|
||||
Reference in New Issue
Block a user