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

import { chatQueryKeys } from '../chat-query-keys';
import { chatApi, type PostSetSettings } from '../chat-api';

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

export const usePostSetMuteMutation = () => {
  return useMutation<ResponseType, BaseAxiosError, PostSetSettings, ResponseType>({
    mutationKey: chatQueryKeys.setMute(),
    mutationFn: async (data) => {
      const response = await chatApi.setMute(data);
      return response.data;
    }
  });
};
