import { useQuery } from '@tanstack/react-query';
import { getArchiveMessages } from '../service/ArchiveService';
import { MessageListQueryDto } from '../types/ArchiveTypes';

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