From 925864828caa3a2532296304b3460a4537695d86 Mon Sep 17 00:00:00 2001 From: marsalva Date: Sun, 15 Feb 2026 23:16:36 +0000 Subject: [PATCH] Actualizar server.js --- server.js | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/server.js b/server.js index ca4bc56..42b3d13 100644 --- a/server.js +++ b/server.js @@ -364,13 +364,15 @@ 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 - await client.query(` - UPDATE scraped_services - SET status = 'imported', - automation_status = 'completed', - raw_data = raw_data || jsonb_build_object('assigned_to', $1) - WHERE id = $2 - `, [ping.user_id, ping.scraped_id]); + // 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]); } else { await client.query("UPDATE assignment_pings SET status = 'rejected', expires_at = NOW() WHERE id = $1", [ping.id]);