ultisuite-client/lib/api/hooks/use-reindex-message-attachments.ts
R3D347HR4Y 8a02c10ba3 Add environment configuration and update email view components
- Created a .cursorignore file to manage local environment files.
- Updated .env.example to reflect changes in the public app URL.
- Modified the gmail workspace configuration to include the drive-suite path.
- Enhanced email view components to support attachment handling and fallback for plain text bodies.
- Improved user experience by updating attachment display logic and integrating inline attachment support.
2026-06-04 00:12:43 +02:00

22 lines
701 B
TypeScript

"use client"
import { useMutation, useQueryClient } from "@tanstack/react-query"
import { apiClient } from "../client"
export function useReindexMessageAttachments(messageId: string | undefined) {
const queryClient = useQueryClient()
return useMutation({
mutationFn: () =>
apiClient.post<{ status: string }>(
`/mail/messages/${messageId}/attachments/reindex`
),
onSuccess: () => {
if (!messageId) return
queryClient.invalidateQueries({ queryKey: ["message-cid-map", messageId] })
queryClient.invalidateQueries({ queryKey: ["message-attachments", messageId] })
queryClient.invalidateQueries({ queryKey: ["message", messageId] })
},
})
}