feat: mail attachment support — sync, display, download, upload
This commit is contained in:
@@ -39,9 +39,11 @@ export interface MailAttachment {
|
||||
mail_id: string;
|
||||
filename: string;
|
||||
mime_type: string;
|
||||
size_bytes: number;
|
||||
size: number;
|
||||
content_id?: string | null;
|
||||
is_inline: boolean;
|
||||
dms_file_id?: string | null;
|
||||
}
|
||||
|
||||
export interface Mail {
|
||||
@@ -461,6 +463,22 @@ export function downloadAttachment(mailId: string, attachmentId: string): Promis
|
||||
}).then((res) => res.data);
|
||||
}
|
||||
|
||||
export interface UploadedAttachment {
|
||||
id: string;
|
||||
filename: string;
|
||||
mime_type: string;
|
||||
size_bytes: number;
|
||||
path: string;
|
||||
}
|
||||
|
||||
export function uploadAttachment(file: File): Promise<UploadedAttachment> {
|
||||
const formData = new FormData();
|
||||
formData.append('file', file);
|
||||
return apiClient.post<UploadedAttachment>('/mail/upload-attachment', formData, {
|
||||
headers: { 'Content-Type': 'multipart/form-data' },
|
||||
}).then((res) => res.data);
|
||||
}
|
||||
|
||||
// ─── Templates ──────────────────────────────────────────────────────────────
|
||||
|
||||
export function createTemplate(payload: CreateTemplatePayload): Promise<MailTemplate> {
|
||||
|
||||
Reference in New Issue
Block a user