From ea9f3b72f749d9647fe361768155f50df0de8c47 Mon Sep 17 00:00:00 2001 From: miguel Date: Wed, 18 Jun 2025 12:41:06 -0600 Subject: [PATCH] fix: Update variable names from id_evento to id_cuestionario for consistency in QR scanning and attendance registration --- src/app/(admins)/staff/page.tsx | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/app/(admins)/staff/page.tsx b/src/app/(admins)/staff/page.tsx index 7a2a90f..6aa1277 100644 --- a/src/app/(admins)/staff/page.tsx +++ b/src/app/(admins)/staff/page.tsx @@ -12,7 +12,7 @@ const Modal = dynamic(() => import('@/components/modal'), { ssr: false }); export default function Page() { const [scannedData, setScannedData] = useState<{ id_participante: number; - id_evento: number; + id_cuestionario: number; } | null>(null); const [showModal, setShowModal] = useState(false); @@ -27,21 +27,21 @@ export default function Page() { try { const data = JSON.parse(rawValue); - if (data.id_participante && data.id_evento) { + if (data.id_participante && data.id_cuestionario) { try { const response = await axiosInstance.get( - `/participante-evento/${data.id_participante}/${data.id_evento}` + `/participante-evento/${data.id_participante}/${data.id_cuestionario}` ); setParticipante(response.data.participante.correo); setScannedData({ id_participante: data.id_participante, - id_evento: data.id_evento, + id_cuestionario: data.id_cuestionario, }); setShowModal(true); setEnableScan(false); } catch (err) { - console.warn('Participante no registrado en el evento:', err); + console.warn('Participante no registrado en el cuestionario:', err); setStatusMessage( '❌ El participante no está registrado en este evento.' ); @@ -60,7 +60,7 @@ export default function Page() { try { const response = await axiosInstance.post( - `/participante-evento/asistencia/${scannedData.id_participante}/${scannedData.id_evento}` + `/participante-evento/asistencia/${scannedData.id_participante}/${scannedData.id_cuestionario}` ); console.log('Asistencia registrada:', response.data);