mirror of
https://github.com/NginxProxyManager/nginx-proxy-manager.git
synced 2025-11-04 17:35:15 +00:00
Certificates react table basis
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
export * from "./useAccessLists";
|
||||
export * from "./useAuditLog";
|
||||
export * from "./useAuditLogs";
|
||||
export * from "./useCertificates";
|
||||
export * from "./useDeadHosts";
|
||||
export * from "./useHealth";
|
||||
export * from "./useHostReport";
|
||||
|
||||
17
frontend/src/hooks/useCertificates.ts
Normal file
17
frontend/src/hooks/useCertificates.ts
Normal file
@@ -0,0 +1,17 @@
|
||||
import { useQuery } from "@tanstack/react-query";
|
||||
import { type Certificate, type CertificateExpansion, getCertificates } from "src/api/backend";
|
||||
|
||||
const fetchCertificates = (expand?: CertificateExpansion[]) => {
|
||||
return getCertificates(expand);
|
||||
};
|
||||
|
||||
const useCertificates = (expand?: CertificateExpansion[], options = {}) => {
|
||||
return useQuery<Certificate[], Error>({
|
||||
queryKey: ["certificates", { expand }],
|
||||
queryFn: () => fetchCertificates(expand),
|
||||
staleTime: 60 * 1000,
|
||||
...options,
|
||||
});
|
||||
};
|
||||
|
||||
export { fetchCertificates, useCertificates };
|
||||
Reference in New Issue
Block a user