umami/src/components/hooks/useWebsite.ts

11 lines
262 B
TypeScript
Raw Normal View History

import useApi from './useApi';
2023-11-14 06:36:52 +01:00
export function useWebsite(websiteId: string) {
const { get, useQuery } = useApi();
return useQuery(['websites', websiteId], () => get(`/websites/${websiteId}`), {
enabled: !!websiteId,
});
}
export default useWebsite;