Actualizar server.js

This commit is contained in:
2026-02-15 23:16:36 +00:00
parent e6b94457a3
commit 925864828c

View File

@@ -364,10 +364,12 @@ app.post("/public/assignment/respond", async (req, res) => {
// ACCIÓN CLAVE: Actualizamos el servicio con el operario asignado
// Guardamos el user_id en el JSON raw_data para que el panel lo lea correctamente
// Sustituye el UPDATE dentro de action === 'accept'
await client.query(`
UPDATE scraped_services
SET status = 'imported',
automation_status = 'completed',
assigned_to = $1,
raw_data = raw_data || jsonb_build_object('assigned_to', $1)
WHERE id = $2
`, [ping.user_id, ping.scraped_id]);