umami/src/components/hooks/queries/useTeam.ts
2024-02-05 23:59:33 -08:00

12 lines
265 B
TypeScript

import useApi from './useApi';
export function useTeam(teamId: string) {
const { get, useQuery } = useApi();
return useQuery({
queryKey: ['teams', teamId],
queryFn: () => get(`/teams/${teamId}`),
enabled: !!teamId,
});
}
export default useTeam;