Preliminary scaffolding for CA structures

This commit is contained in:
Tuan Dang
2024-05-22 21:33:06 -07:00
parent 303edadb1e
commit 26ea949a4e
41 changed files with 1656 additions and 8 deletions
+23
View File
@@ -0,0 +1,23 @@
import {
useMutation
// useQueryClient
} from "@tanstack/react-query";
import { apiRequest } from "@app/config/request";
import { TCertificateAuthority, TCreateCaDTO } from "./types";
export const useCreateCa = () => {
// const queryClient = useQueryClient();
return useMutation<TCertificateAuthority, {}, TCreateCaDTO>({
mutationFn: async (body) => {
const {
data: { identity }
} = await apiRequest.post("/api/v1/ca/", body);
return identity;
},
onSuccess: () => {
// queryClient.invalidateQueries(organizationKeys.getOrgIdentityMemberships(organizationId));
}
});
};