Implementazioni varie
This commit is contained in:
@@ -128,6 +128,29 @@ export const messagesApi = {
|
||||
getReceipts: (id: string) =>
|
||||
apiClient.get<MessageResponse[]>(`/messages/${id}/receipts`).then((r) => r.data),
|
||||
|
||||
// ─── Feature 3: Thread ────────────────────────────────────────────────────
|
||||
|
||||
getThread: (id: string) =>
|
||||
apiClient.get<MessageResponse[]>(`/messages/${id}/thread`).then((r) => r.data),
|
||||
|
||||
// ─── Feature 7: Preview allegati ─────────────────────────────────────────
|
||||
|
||||
getAttachmentPreviewUrl: (messageId: string, attachmentId: string) =>
|
||||
apiClient.get<{
|
||||
previewable: boolean
|
||||
content_type: string
|
||||
filename: string
|
||||
url?: string
|
||||
}>(`/messages/${messageId}/attachments/${attachmentId}/preview-url`).then((r) => r.data),
|
||||
|
||||
// ─── Feature 8: Stampa ────────────────────────────────────────────────────
|
||||
|
||||
/** Apre la vista di stampa HTML in una nuova tab. */
|
||||
openPrint: (messageId: string, token: string) => {
|
||||
const baseUrl = (window as any).__API_BASE_URL__ || '/api/v1'
|
||||
window.open(`${baseUrl}/messages/${messageId}/print?token=${token}`, '_blank')
|
||||
},
|
||||
|
||||
/**
|
||||
* Scarica il pacchetto ZIP completo della PEC (postacert.eml, daticert.xml,
|
||||
* ricevute di accettazione/consegna per le mail outbound).
|
||||
|
||||
Reference in New Issue
Block a user