mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-18 16:40:14 +00:00
Finish preliminary loop on SSH certificates
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
import { useQuery } from "@tanstack/react-query";
|
||||
|
||||
import { apiRequest } from "@app/config/request";
|
||||
|
||||
import { TSshCertificateTemplate } from "./types";
|
||||
|
||||
export const certTemplateKeys = {
|
||||
getSshCertTemplateById: (id: string) => [{ id }, "ssh-cert-template"]
|
||||
};
|
||||
|
||||
export const useGetSshCertTemplate = (id: string) => {
|
||||
return useQuery({
|
||||
queryKey: certTemplateKeys.getSshCertTemplateById(id),
|
||||
queryFn: async () => {
|
||||
const { data: certificateTemplate } = await apiRequest.get<TSshCertificateTemplate>(
|
||||
`/api/v1/ssh/certificate-templates/${id}`
|
||||
);
|
||||
return certificateTemplate;
|
||||
},
|
||||
enabled: Boolean(id)
|
||||
});
|
||||
};
|
||||
Reference in New Issue
Block a user