fix: Update variable names from id_evento to id_cuestionario for consistency in QR scanning and attendance registration

This commit is contained in:
miguel
2025-06-18 12:41:06 -06:00
parent b110109cb3
commit ea9f3b72f7
+6 -6
View File
@@ -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);