Files
automatisch/packages/web/src/hooks/useAutomatischInfo.js
Ali BARIN a57134a89c feat(AppConfig): iterate how apps are managed
- auth clients are always shared, cannot be disabled
- custom connections are enabled by default, can be disabled
- any existing connections can be reconnected regardless of its AppConfig or AppAuthClient states
2024-12-17 14:26:55 +00:00

21 lines
529 B
JavaScript

import { useQuery } from '@tanstack/react-query';
import api from 'helpers/api';
export default function useAutomatischInfo() {
const query = useQuery({
/**
* The data doesn't change by user actions, but only by server deployments.
* So we can set the `staleTime` to Infinity
**/
staleTime: Infinity,
queryKey: ['automatisch', 'info'],
queryFn: async ({ signal }) => {
const { data } = await api.get('/v1/automatisch/info', { signal });
return data;
},
});
return query;
}