feat(search): add advanced attachment filters for extension, category and mime type

This commit is contained in:
rustmailer
2026-03-19 20:23:20 +08:00
parent 884fdeba10
commit c19f3977ba
31 changed files with 466 additions and 40 deletions
+14
View File
@@ -0,0 +1,14 @@
import { AttachmentMetadata, get_attachment_meta } from '@/api/mailbox/envelope/api';
import { useQuery, UseQueryOptions } from '@tanstack/react-query';
export const ATTACHMENT_METADATA_KEY = ['attachment_metadata'] as const;
export const useAttachmentMetadata = (options?: Partial<UseQueryOptions<AttachmentMetadata>>) => {
return useQuery({
queryKey: ATTACHMENT_METADATA_KEY,
queryFn: get_attachment_meta,
staleTime: 1000 * 60 * 10,
gcTime: 1000 * 60 * 30,
...options,
});
};