mirror of
https://github.com/idrainformatica/PecFlow.git
synced 2026-06-16 12:45:42 +02:00
vbox funzionanti
This commit is contained in:
@@ -8,6 +8,8 @@ import type {
|
||||
export interface MessageFilters {
|
||||
page?: number
|
||||
page_size?: number
|
||||
/** Filtra per Virtual Box assegnata all'utente corrente */
|
||||
vbox_id?: string
|
||||
mailbox_id?: string
|
||||
direction?: 'inbound' | 'outbound'
|
||||
state?: string
|
||||
@@ -17,6 +19,17 @@ export interface MessageFilters {
|
||||
search?: string
|
||||
}
|
||||
|
||||
export interface MessageBulkUpdatePayload {
|
||||
ids: string[]
|
||||
is_starred?: boolean
|
||||
is_archived?: boolean
|
||||
}
|
||||
|
||||
export interface MessageBulkUpdateResponse {
|
||||
updated: number
|
||||
items: MessageResponse[]
|
||||
}
|
||||
|
||||
export const messagesApi = {
|
||||
list: (filters: MessageFilters = {}) =>
|
||||
apiClient
|
||||
@@ -42,6 +55,17 @@ export const messagesApi = {
|
||||
.patch<MessageResponse>(`/messages/${id}`, { is_archived: true })
|
||||
.then((r) => r.data),
|
||||
|
||||
unarchive: (id: string) =>
|
||||
apiClient
|
||||
.patch<MessageResponse>(`/messages/${id}`, { is_archived: false })
|
||||
.then((r) => r.data),
|
||||
|
||||
/** Aggiorna in blocco is_starred e/o is_archived su più messaggi */
|
||||
bulkUpdate: (payload: MessageBulkUpdatePayload) =>
|
||||
apiClient
|
||||
.patch<MessageBulkUpdateResponse>('/messages/bulk', payload)
|
||||
.then((r) => r.data),
|
||||
|
||||
getAttachments: (id: string) =>
|
||||
apiClient.get<AttachmentResponse[]>(`/messages/${id}/attachments`).then((r) => r.data),
|
||||
|
||||
|
||||
Reference in New Issue
Block a user