mirror of
https://github.com/NginxProxyManager/nginx-proxy-manager.git
synced 2025-10-04 11:50:09 +00:00
DNS Provider configuration
This commit is contained in:
17
frontend/src/hooks/useDnsProviders.ts
Normal file
17
frontend/src/hooks/useDnsProviders.ts
Normal file
@@ -0,0 +1,17 @@
|
||||
import { useQuery } from "@tanstack/react-query";
|
||||
import { type DNSProvider, getCertificateDNSProviders } from "src/api/backend";
|
||||
|
||||
const fetchDnsProviders = () => {
|
||||
return getCertificateDNSProviders();
|
||||
};
|
||||
|
||||
const useDnsProviders = (options = {}) => {
|
||||
return useQuery<DNSProvider[], Error>({
|
||||
queryKey: ["dns-providers"],
|
||||
queryFn: () => fetchDnsProviders(),
|
||||
staleTime: 300 * 1000,
|
||||
...options,
|
||||
});
|
||||
};
|
||||
|
||||
export { fetchDnsProviders, useDnsProviders };
|
Reference in New Issue
Block a user