fix(desktop): corrige parâmetros invoke para snake_case no Tauri 2

Tauri 2 espera parâmetros em snake_case nos comandos Rust.
Corrigido: ticketId -> ticket_id, ticketRef -> ticket_ref, etc.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
rever-tecnologia 2025-12-15 14:24:01 -03:00
parent 915ca6d8ff
commit 3b6b9dfeac
3 changed files with 13 additions and 12 deletions

View file

@ -292,7 +292,7 @@ export function ChatWidget({ ticketId, ticketRef }: ChatWidgetProps) {
useEffect(() => {
const prevHasSession = prevHasSessionRef.current
if (prevHasSession && !hasSession) {
invoke("close_chat_window", { ticketId }).catch((err) => {
invoke("close_chat_window", { ticket_id: ticketId }).catch((err) => {
console.error("Erro ao fechar janela ao encerrar sessão:", err)
})
}
@ -405,10 +405,10 @@ export function ChatWidget({ ticketId, ticketRef }: ChatWidgetProps) {
for (const chunk of chunks) {
await invoke("mark_chat_messages_read", {
baseUrl: cfg.apiBaseUrl,
base_url: cfg.apiBaseUrl,
token: cfg.token,
ticketId,
messageIds: chunk,
ticket_id: ticketId,
message_ids: chunk,
})
}
@ -657,9 +657,9 @@ export function ChatWidget({ ticketId, ticketRef }: ChatWidgetProps) {
const bodyToSend = messageText
const cfg = await ensureConfig()
await invoke("send_chat_message", {
baseUrl: cfg.apiBaseUrl,
base_url: cfg.apiBaseUrl,
token: cfg.token,
ticketId,
ticket_id: ticketId,
body: bodyToSend,
attachments: attachmentsToSend.length > 0 ? attachmentsToSend : undefined,
})
@ -692,7 +692,7 @@ export function ChatWidget({ ticketId, ticketRef }: ChatWidgetProps) {
const handleMinimize = async () => {
setIsMinimized(true)
try {
await invoke("set_chat_minimized", { ticketId, minimized: true })
await invoke("set_chat_minimized", { ticket_id: ticketId, minimized: true })
} catch (err) {
console.error("Erro ao minimizar janela:", err)
}
@ -707,14 +707,14 @@ export function ChatWidget({ ticketId, ticketRef }: ChatWidgetProps) {
setIsMinimized(false)
try {
await invoke("set_chat_minimized", { ticketId, minimized: false })
await invoke("set_chat_minimized", { ticket_id: ticketId, minimized: false })
} catch (err) {
console.error("Erro ao expandir janela:", err)
}
}
const handleClose = () => {
invoke("close_chat_window", { ticketId })
invoke("close_chat_window", { ticket_id: ticketId })
}
const handleKeyDown = (e: React.KeyboardEvent) => {