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

import { rankingQueryKeys } from '../ranking-query-keys';
import { type PostGetRanking, rankingApi } from '../ranking-api';

import type { BaseAxiosError } from '../../../../types';

export const fetchFullRanking = () => {
  return useMutation<PostGetRanking, BaseAxiosError, void>({
    mutationKey: rankingQueryKeys.getFullRanking(),
    mutationFn: async () => {
      const response = await rankingApi.getFullRanking();
      
      return response.data;
    }
  });
};
