mirror of
https://github.com/NginxProxyManager/nginx-proxy-manager.git
synced 2025-11-04 17:35:15 +00:00
Certificates react work
- renewal and download - table columns rendering - searching - deleting
This commit is contained in:
@@ -2,6 +2,7 @@ export * from "./useAccessList";
|
||||
export * from "./useAccessLists";
|
||||
export * from "./useAuditLog";
|
||||
export * from "./useAuditLogs";
|
||||
export * from "./useCertificate";
|
||||
export * from "./useCertificates";
|
||||
export * from "./useDeadHost";
|
||||
export * from "./useDeadHosts";
|
||||
|
||||
17
frontend/src/hooks/useCertificate.ts
Normal file
17
frontend/src/hooks/useCertificate.ts
Normal file
@@ -0,0 +1,17 @@
|
||||
import { useQuery } from "@tanstack/react-query";
|
||||
import { type Certificate, getCertificate } from "src/api/backend";
|
||||
|
||||
const fetchCertificate = (id: number) => {
|
||||
return getCertificate(id, ["owner"]);
|
||||
};
|
||||
|
||||
const useCertificate = (id: number, options = {}) => {
|
||||
return useQuery<Certificate, Error>({
|
||||
queryKey: ["certificate", id],
|
||||
queryFn: () => fetchCertificate(id),
|
||||
staleTime: 60 * 1000, // 1 minute
|
||||
...options,
|
||||
});
|
||||
};
|
||||
|
||||
export { useCertificate };
|
||||
Reference in New Issue
Block a user