feat(frontend): adapt message list logic for Gmail API compatibility

This commit is contained in:
rustmailer
2025-10-05 15:50:21 +08:00
parent 1e37ad2eb1
commit e6d35fc808
9 changed files with 238 additions and 105 deletions
+7 -2
View File
@@ -122,8 +122,13 @@ export const move_messages = async (accountId: number, payload: Record<string, a
return response.data;
};
export const get_full_message = async (accountId: number, mailbox: string, uid: number, subject: string) => {
const response = await axiosInstance.get(`/api/v1/full-message/${accountId}?mailbox=${mailbox}&uid=${uid}`, { responseType: 'blob' });
export const copy_messages = async (accountId: number, payload: Record<string, any>) => {
const response = await axiosInstance.post(`/api/v1/copy-messages/${accountId}`, payload);
return response.data;
};
export const get_full_message = async (accountId: number, mailbox: string, id: string, subject: string) => {
const response = await axiosInstance.get(`/api/v1/raw-message/${accountId}?mailbox=${mailbox}&id=${id}`, { responseType: 'blob' });
const blob = new Blob([response.data]);
let filename = subject.replace(/\.eml$/i, '');
saveAs(blob, `${filename}.eml`);