mirror of
https://github.com/NginxProxyManager/nginx-proxy-manager.git
synced 2025-08-05 08:53:36 +00:00
Table improvements, add modals
This commit is contained in:
19
frontend/src/hooks/useUpstreamNginxConfig.ts
Normal file
19
frontend/src/hooks/useUpstreamNginxConfig.ts
Normal file
@@ -0,0 +1,19 @@
|
||||
import { getUpstreamNginxConfig } from "api/npm";
|
||||
import { useQuery } from "react-query";
|
||||
|
||||
const fetchUpstreamNginxConfig = (id: any) => {
|
||||
return getUpstreamNginxConfig(id);
|
||||
};
|
||||
|
||||
const useUpstreamNginxConfig = (id: number, options = {}) => {
|
||||
return useQuery<string, Error>(
|
||||
["upstream-nginx-config", id],
|
||||
() => fetchUpstreamNginxConfig(id),
|
||||
{
|
||||
staleTime: 30 * 1000, // 30 seconds
|
||||
...options,
|
||||
},
|
||||
);
|
||||
};
|
||||
|
||||
export { useUpstreamNginxConfig };
|
Reference in New Issue
Block a user