mirror of
https://github.com/idrainformatica/PecFlow.git
synced 2026-06-16 12:45:42 +02:00
Trash!
This commit is contained in:
@@ -16,13 +16,16 @@ export interface MessageFilters {
|
||||
is_read?: boolean
|
||||
is_starred?: boolean
|
||||
is_archived?: boolean
|
||||
is_trashed?: boolean
|
||||
search?: string
|
||||
}
|
||||
|
||||
export interface MessageBulkUpdatePayload {
|
||||
ids: string[]
|
||||
is_read?: boolean
|
||||
is_starred?: boolean
|
||||
is_archived?: boolean
|
||||
is_trashed?: boolean
|
||||
}
|
||||
|
||||
export interface MessageBulkUpdateResponse {
|
||||
@@ -60,7 +63,17 @@ export const messagesApi = {
|
||||
.patch<MessageResponse>(`/messages/${id}`, { is_archived: false })
|
||||
.then((r) => r.data),
|
||||
|
||||
/** Aggiorna in blocco is_starred e/o is_archived su più messaggi */
|
||||
trash: (id: string) =>
|
||||
apiClient
|
||||
.patch<MessageResponse>(`/messages/${id}`, { is_trashed: true })
|
||||
.then((r) => r.data),
|
||||
|
||||
untrash: (id: string) =>
|
||||
apiClient
|
||||
.patch<MessageResponse>(`/messages/${id}`, { is_trashed: false })
|
||||
.then((r) => r.data),
|
||||
|
||||
/** Aggiorna in blocco is_starred e/o is_archived e/o is_trashed su più messaggi */
|
||||
bulkUpdate: (payload: MessageBulkUpdatePayload) =>
|
||||
apiClient
|
||||
.patch<MessageBulkUpdateResponse>('/messages/bulk', payload)
|
||||
|
||||
Reference in New Issue
Block a user