import { useMutation, useQuery } from '@tanstack/react-query';
import { emptySpam, getSpamMessages } from '../service/SpamService';
import { MessageListQueryDto } from '../types/SpamTypes';

export const useGetSpamMessages = (query: MessageListQueryDto) => {
    return useQuery({
        queryKey: ['spam-messages', query],
        queryFn: () => getSpamMessages(query),
        staleTime: 0
    });
};

export const useEmptySpam = () => {
    return useMutation({
        mutationFn: () => emptySpam(),
    });
}; 