website refactor
This commit is contained in:
@@ -1,16 +0,0 @@
|
||||
import { useQuery } from '@tanstack/react-query';
|
||||
import { useInject } from '@/lib/di/hooks/useInject';
|
||||
import { TEAM_SERVICE_TOKEN } from '@/lib/di/tokens';
|
||||
import { enhanceQueryResult } from '@/lib/di/hooks/useReactQueryWithApiError';
|
||||
|
||||
export function useTeamMembers(teamId: string, currentUserId: string, teamOwnerId: string) {
|
||||
const teamService = useInject(TEAM_SERVICE_TOKEN);
|
||||
|
||||
const queryResult = useQuery({
|
||||
queryKey: ['teamMembers', teamId, currentUserId, teamOwnerId],
|
||||
queryFn: () => teamService.getTeamMembers(teamId, currentUserId, teamOwnerId),
|
||||
enabled: !!teamId && !!currentUserId && !!teamOwnerId,
|
||||
});
|
||||
|
||||
return enhanceQueryResult(queryResult);
|
||||
}
|
||||
Reference in New Issue
Block a user