diff --git a/client-monitor.js b/client-monitor.js index 5e2e865..6cdf621 100644 --- a/client-monitor.js +++ b/client-monitor.js @@ -1175,6 +1175,7 @@ function connectToServer() { const db = getLocalDb(); if (!db) { addLog('❌ Falha ao acessar banco de dados local para CRUD.'); + if (data.eventId) socket.emit('remote-crud-ack', { eventId: data.eventId, pcName: config.clientName, success: false, error: 'Falha banco local' }); return; } if (data.action === 'create') { @@ -1197,8 +1198,14 @@ function connectToServer() { stmt.run(pName); addLog('✅ Paciente excluído com sucesso localmente!'); } + if (data.eventId) { + socket.emit('remote-crud-ack', { eventId: data.eventId, pcName: config.clientName, success: true }); + } } catch (e) { addLog(`❌ Erro no CRUD remoto: ${e.message}`); + if (data.eventId) { + socket.emit('remote-crud-ack', { eventId: data.eventId, pcName: config.clientName, success: false, error: e.message }); + } } }); } diff --git a/package-lock.json b/package-lock.json index b3df9a6..267abda 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "rx.scoreodonto.com-client", - "version": "1.3.1", + "version": "1.3.3", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "rx.scoreodonto.com-client", - "version": "1.3.1", + "version": "1.3.3", "dependencies": { "chokidar": "^3.5.3", "electron-updater": "^6.3.0", diff --git a/package.json b/package.json index f0ce66c..49625d0 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "rx.scoreodonto.com-client", - "version": "1.3.2", + "version": "1.3.3", "author": "ScoreOdonto", "description": "Cliente Windows para envio de imagens dentais da ScoreOdonto", "main": "index.js",