fix: adiciona JWT_SECRET e ALLOWED_ORIGINS no docker-compose, e corrige enabled=1 para PostgreSQL nas rotas de imagens
continuous-integration/webhook Deploy concluido (rx.scoreodonto.com)
continuous-integration/webhook Deploy concluido (rx.scoreodonto.com)
This commit is contained in:
@@ -139,7 +139,7 @@ router.get('/:id', async (req, res) => {
|
||||
router.get('/stats', async (req, res) => {
|
||||
try {
|
||||
const total = await db.get('SELECT COUNT(*) as count FROM images');
|
||||
const enabled = await db.get('SELECT COUNT(*) as count FROM images WHERE enabled = 1');
|
||||
const enabled = await db.get('SELECT COUNT(*) as count FROM images WHERE enabled = true');
|
||||
const withTooth = await db.get('SELECT COUNT(*) as count FROM images WHERE tooth_number IS NOT NULL');
|
||||
|
||||
res.json({
|
||||
@@ -305,7 +305,7 @@ router.put('/:id/patient-info', async (req, res) => {
|
||||
patient_name_resumed = $1,
|
||||
tooth_number = $2,
|
||||
tooth_side = $3,
|
||||
enabled = 1
|
||||
enabled = true
|
||||
WHERE id = $4`,
|
||||
[patientNameResumed, toothNumber, toothSide, req.params.id]
|
||||
);
|
||||
|
||||
@@ -747,7 +747,7 @@ io.on('connection', (socket) => {
|
||||
|
||||
// Verificar se a imagem já foi inserida no banco
|
||||
const existing = await db.get(
|
||||
"SELECT id, filename FROM images WHERE original_filename = $1 AND enabled = 1 LIMIT 1",
|
||||
"SELECT id, filename FROM images WHERE original_filename = $1 AND enabled = true LIMIT 1",
|
||||
[data.metadata.fileName]
|
||||
);
|
||||
if (existing) {
|
||||
@@ -871,7 +871,7 @@ io.on('connection', (socket) => {
|
||||
}
|
||||
|
||||
const existing = await db.get(
|
||||
"SELECT id, filename FROM images WHERE original_filename = $1 AND enabled = 1 LIMIT 1",
|
||||
"SELECT id, filename FROM images WHERE original_filename = $1 AND enabled = true LIMIT 1",
|
||||
[data.fileName]
|
||||
);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user