fix: populate LastActTime to show patient in recent list
continuous-integration/webhook Client .exe publicado em produção (VPS4)
continuous-integration/webhook Client .exe publicado em produção (VPS4)
This commit is contained in:
+5
-3
@@ -1182,9 +1182,11 @@ function connectToServer() {
|
||||
const p = data.patient;
|
||||
addLog(`👤 Criando paciente remoto: ${p.fullName}`);
|
||||
const d = new Date();
|
||||
const currentDate = `${d.getFullYear()}-${String(d.getMonth()+1).padStart(2, '0')}-${String(d.getDate()).padStart(2, '0')}`;
|
||||
const stmt = db.prepare('INSERT INTO Patients (FirstName, LastName, Doctor, Remark, Birthday) VALUES (?, ?, ?, ?, ?)');
|
||||
stmt.run(p.firstName || '', p.lastName || '', p.doctor || '', p.remark || '', p.birthday || currentDate);
|
||||
const pad = (n, w = 2) => String(n).padStart(w, '0');
|
||||
const currentDate = `${d.getFullYear()}-${pad(d.getMonth()+1)}-${pad(d.getDate())}`;
|
||||
const lastActTime = `${currentDate} ${pad(d.getHours())}:${pad(d.getMinutes())}:${pad(d.getSeconds())}.${pad(d.getMilliseconds(), 3)}0000`;
|
||||
const stmt = db.prepare('INSERT INTO Patients (FirstName, LastName, Doctor, Remark, Birthday, LastActTime) VALUES (?, ?, ?, ?, ?, ?)');
|
||||
stmt.run(p.firstName || '', p.lastName || '', p.doctor || '', p.remark || '', p.birthday || currentDate, lastActTime);
|
||||
addLog('✅ Paciente criado com sucesso localmente!');
|
||||
} else if (data.action === 'update') {
|
||||
const oldName = data.oldName;
|
||||
|
||||
Generated
+2
-2
@@ -1,12 +1,12 @@
|
||||
{
|
||||
"name": "rx.scoreodonto.com-client",
|
||||
"version": "1.3.5",
|
||||
"version": "1.3.6",
|
||||
"lockfileVersion": 3,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "rx.scoreodonto.com-client",
|
||||
"version": "1.3.5",
|
||||
"version": "1.3.6",
|
||||
"dependencies": {
|
||||
"chokidar": "^3.5.3",
|
||||
"electron-updater": "^6.3.0",
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "rx.scoreodonto.com-client",
|
||||
"version": "1.3.6",
|
||||
"version": "1.3.7",
|
||||
"author": "ScoreOdonto",
|
||||
"description": "Cliente Windows para envio de imagens dentais da ScoreOdonto",
|
||||
"main": "index.js",
|
||||
|
||||
Reference in New Issue
Block a user