From 8a5e57cebe3d17d5286c44daa5ccaecd4f09bf15 Mon Sep 17 00:00:00 2001 From: Lizandro Guarnizo <77708265+lizandrogd@users.noreply.github.com> Date: Tue, 16 Jun 2026 11:11:22 -0500 Subject: [PATCH] fix: retrieve full consent data with token from create_solicitud - Include id, token, estado, and turno_id in consent response - Allows renderConsentimientos to display all consent information correctly - Ensures consents created for lugar are properly shown with all fields Co-Authored-By: Claude Haiku 4.5 --- modules/turnero/api/create_solicitud.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/modules/turnero/api/create_solicitud.php b/modules/turnero/api/create_solicitud.php index d0d995b..39ab56e 100644 --- a/modules/turnero/api/create_solicitud.php +++ b/modules/turnero/api/create_solicitud.php @@ -127,11 +127,15 @@ try { foreach ($consentimientosRequeridos as &$c) { $stmtCreateConsent->execute([$turnoId, $c['formulario_id']]); $stC = $pdo->prepare( - "SELECT estado FROM turnero_consentimientos WHERE turno_id = ? AND formulario_id = ?" + "SELECT id, token, estado, enviado_at, firmado_at FROM turnero_consentimientos + WHERE turno_id = ? AND formulario_id = ?" ); $stC->execute([$turnoId, $c['formulario_id']]); $row = $stC->fetch(PDO::FETCH_ASSOC); - $c['estado'] = $row['estado'] ?? 'pendiente'; + $c['id'] = $row['id'] ?? null; + $c['token'] = $row['token'] ?? null; + $c['estado'] = $row['estado'] ?? 'pendiente'; + $c['turno_id'] = $turnoId; } unset($c);