Files
gridpilot.gg/apps/website/hooks/team/useLeaveTeam.ts
2026-01-16 01:00:03 +01:00

19 lines
634 B
TypeScript

import { useMutation, UseMutationOptions } from '@tanstack/react-query';
import { ApiError } from '@/lib/api/base/ApiError';
interface LeaveTeamParams {
teamId: string;
driverId: string;
}
export function useLeaveTeam(options?: Omit<UseMutationOptions<void, ApiError, LeaveTeamParams>, 'mutationFn'>) {
return useMutation<void, ApiError, LeaveTeamParams>({
mutationFn: async (params) => {
// Note: Leave team functionality would need to be added to teamService
// For now, we'll use a placeholder
console.log('Leaving team:', params);
alert('Successfully left team');
},
...options,
});
}