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:
co-authored by
Claude Haiku 4.5
parent
ea40cf8dae
commit
8a5e57cebe
@@ -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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user