import { useQuery } from 'react-query';

import { employeeLifecycleKeys } from '../queries';
import { getTasksNotifications } from '../services';

export const useTasksNotifications = () => {
  const { data, ...query } = useQuery({
    queryKey: employeeLifecycleKeys.notifications.tasks(),
    queryFn: () => getTasksNotifications(),
    select: response => response.data,
  });

  return {
    ...query,
    notifications: data,
  };
};
