mirror of
https://github.com/Alvin-Zilverstand/nginx-proxy-manager.git
synced 2026-11-22 22:23:21 +01:00
Certificates react table basis
This commit is contained in:
10 files changed
+271
-7
No files matched your search
@@ -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";
|
||||
|
||||
@@ -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