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

import { dareQueryKeys } from '../dare-query-keys';
import { type PostSetDARERegion, dareApi } from '../dare-api';

import type { BaseAxiosError } from '../../../../types';
import { ResponseType } from '@api/response-type';

export const usePostSetDareRegionMutation = () => {
  return useMutation<ResponseType, BaseAxiosError, PostSetDARERegion, ResponseType>({
    mutationKey: dareQueryKeys.setDARERegion(),
    mutationFn: async (data) => {
      const response = await dareApi.setDARERegion(data);
      return response.data;
    }
  });
};
