import { useMutation, useQuery } from '@tanstack/react-query';
import { emptyTrash, getTrashMessages } from '../service/TrashService';
import { MessageListQueryDto } from '../types/TrashTypes';

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

export const useEmptyTrash = () => {
    return useMutation({
        mutationFn: () => emptyTrash(),
    });
};