mirror of
https://github.com/kremalicious/umami.git
synced 2024-06-17 09:53:13 +02:00
15 lines
353 B
TypeScript
15 lines
353 B
TypeScript
'use client';
|
|
import useApi from './useApi';
|
|
|
|
export function useWebsite(websiteId: string, options?: { [key: string]: any }) {
|
|
const { get, useQuery } = useApi();
|
|
return useQuery({
|
|
queryKey: ['websites', websiteId],
|
|
queryFn: () => get(`/websites/${websiteId}`),
|
|
enabled: !!websiteId,
|
|
...options,
|
|
});
|
|
}
|
|
|
|
export default useWebsite;
|