From a8ab910a27fa8ab6d5db2de56d9bd95d494c695b Mon Sep 17 00:00:00 2001 From: marsalva Date: Fri, 3 Apr 2026 14:37:49 +0000 Subject: [PATCH] Actualizar server.js --- server.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/server.js b/server.js index 44a390a..ef9b593 100644 --- a/server.js +++ b/server.js @@ -4958,7 +4958,7 @@ app.get("/public/portal/:token/protection", async (req, res) => { app.post("/public/portal/:token/protection/subscribe", async (req, res) => { try { const { token } = req.params; - const { plan_id, signature, pdf_document } = req.body; // pdf_document trae el archivo firmado real + const { plan_id, signature, pdf_document, dni } = req.body; // 1. Validar cliente const clientQ = await pool.query("SELECT * FROM clients WHERE portal_token = $1", [token]); @@ -4977,7 +4977,7 @@ app.post("/public/portal/:token/protection/subscribe", async (req, res) => { INSERT INTO protection_subscriptions (company_id, plan_id, client_name, client_dni, client_phone, payment_status, status) VALUES ($1, $2, $3, $4, $5, 'impagado', 'suspendido') RETURNING id - `, [ownerId, plan.id, client.full_name, null, client.phone]); + `, [ownerId, plan.id, client.full_name, dni || null, client.phone]); const subscriptionId = subInsert.rows[0].id;