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 <noreply@anthropic.com>
This commit is contained in:
Lizandro Guarnizo
2026-06-16 11:11:22 -05:00
co-authored by Claude Haiku 4.5
parent ea40cf8dae
commit 8a5e57cebe
+6 -2
View File
@@ -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);