import type { QueryClient } from '@tanstack/react-query';

/** 목록 + (선택) 상세 페이지 캐시 갱신 */
export function invalidateTaskCaches(queryClient: QueryClient, taskId?: string | null) {
  void queryClient.invalidateQueries({ queryKey: ['tasks'] });
  if (taskId) {
    void queryClient.invalidateQueries({ queryKey: ['task', taskId] });
  }
}
