umami/src/components/hooks/queries/useTeam.ts

13 lines
265 B
TypeScript
Raw Normal View History

2024-01-29 02:33:40 +00:00
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;