Actualizar server.js
This commit is contained in:
13
server.js
13
server.js
@@ -2800,6 +2800,19 @@ app.get("/worker/notifications", authMiddleware, async (req, res) => {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// 4. Marcar chat como leído por el operario
|
||||||
|
app.post("/services/:id/chat/read", authMiddleware, async (req, res) => {
|
||||||
|
try {
|
||||||
|
await pool.query(
|
||||||
|
"UPDATE scraped_services SET last_chat_read_worker = NOW() WHERE id = $1 AND assigned_to = $2",
|
||||||
|
[req.params.id, req.user.sub]
|
||||||
|
);
|
||||||
|
res.json({ ok: true });
|
||||||
|
} catch (e) {
|
||||||
|
res.status(500).json({ ok: false });
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
// ==========================================
|
// ==========================================
|
||||||
// 💬 CHAT Y COMUNICACIÓN INTERNA (TIPO iTRAMIT)
|
// 💬 CHAT Y COMUNICACIÓN INTERNA (TIPO iTRAMIT)
|
||||||
// ==========================================
|
// ==========================================
|
||||||
|
|||||||
Reference in New Issue
Block a user