From 243bd1afc1a78f4c7acab0ccbfa7997fcb4723ee Mon Sep 17 00:00:00 2001 From: dscadmin Date: Tue, 8 Apr 2025 11:02:05 -0600 Subject: [PATCH 1/2] Establecer scripts dev y prod con puertos correspondientes --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 9d10668..c76b57b 100644 --- a/package.json +++ b/package.json @@ -7,7 +7,7 @@ "build": "next build", "start:local": "next build && next start -p 3246", "start:dev": "source ~/.nvm/nvm.sh && nvm use 22.10.0 && npm install && next build && next start -p 3246", - "start:prod": "source ~/.nvm/nvm.sh && nvm use 22.10.0 && npm install && next build && next start -p 3246", + "start:prod": "source ~/.nvm/nvm.sh && nvm use 22.10.0 && npm install && next build && next start -p 3240", "lint": "next lint" }, "dependencies": { -- 2.43.0 From 404dd3a627c207230bcb779c6fb5f93a305dc1f9 Mon Sep 17 00:00:00 2001 From: jalvarado Date: Tue, 8 Apr 2025 18:16:04 -0600 Subject: [PATCH 2/2] CAmbio de boton --- .../formulario/[id_formulario]/page.tsx | 21 +++++++++++++ src/app/(admins)/administrador/page.tsx | 30 +++++++++++-------- src/app/(admins)/staff/lista-manual/page.tsx | 24 --------------- src/app/(public)/page.tsx | 2 +- 4 files changed, 39 insertions(+), 38 deletions(-) diff --git a/src/app/(admins)/administrador/formulario/[id_formulario]/page.tsx b/src/app/(admins)/administrador/formulario/[id_formulario]/page.tsx index 0992585..fe68614 100644 --- a/src/app/(admins)/administrador/formulario/[id_formulario]/page.tsx +++ b/src/app/(admins)/administrador/formulario/[id_formulario]/page.tsx @@ -1,8 +1,10 @@ 'use client'; +import Button from '@/components/button'; import Input from '@/components/input'; import Table, { Header } from '@/components/table'; import { ParticipacionEvento } from '@/types/participante-evento'; import axiosInstance from '@/utils/api-config'; +import { downloadFile } from '@/utils/downloas-utils'; import { useParams } from 'next/navigation'; import React, { useEffect } from 'react'; import toast from 'react-hot-toast'; @@ -116,10 +118,29 @@ export default function Page() { p.participante.correo.toLowerCase().includes(busquedaCorreo.toLowerCase()) ); + const handleDownload = async () => { + try { + const res = await axiosInstance.get( + `/cuestionario-respondido/reporte-respuestas/${id_formulario}`, + { + responseType: 'blob', + } + ); + + downloadFile(res.data, 'lista_participantes', 'xlsx'); + } catch (error) { + toast.error('Error al descargar la lista de participantes'); + console.error('Error al descargar la lista de participantes:', error); + } + }; + return (

Participantes del formulario #{id_formulario}

+ {participantes.length > 0 && ( <> -
+
- {eventos.map((cuestionario) => ( - - ))} - {eventos.length === 0 && ( -

- No hay formularios disponibles. -

- )} + {eventos.map((cuestionario, index) => { + const fadeClass = `delay-${(index % 5) + 1}`; + + return ( +
+ +
+ ); + })}
diff --git a/src/app/(admins)/staff/lista-manual/page.tsx b/src/app/(admins)/staff/lista-manual/page.tsx index fbec8d3..2dfcfe6 100644 --- a/src/app/(admins)/staff/lista-manual/page.tsx +++ b/src/app/(admins)/staff/lista-manual/page.tsx @@ -6,7 +6,6 @@ import Table, { Header } from '@/components/table'; import { GetCuestionario } from '@/types/cuestionario'; import { ParticipacionEvento } from '@/types/participante-evento'; import axiosInstance from '@/utils/api-config'; -import { downloadFile } from '@/utils/downloas-utils'; import React, { useEffect } from 'react'; import toast from 'react-hot-toast'; @@ -73,9 +72,6 @@ export default function Page() { Record >({}); const [busquedaCorreo, setBusquedaCorreo] = React.useState(''); - const [idEventoSeleccionado, setIdEventoSeleccionado] = React.useState< - number | null - >(null); useEffect(() => { const getEventos = async () => { @@ -93,7 +89,6 @@ export default function Page() { const handleOnSelect = async (idSeleccionado: number) => { try { - setIdEventoSeleccionado(idSeleccionado); const { data } = await axiosInstance.get( `/participante-evento/evento/${idSeleccionado}` ); @@ -128,22 +123,6 @@ export default function Page() { p.participante.correo.toLowerCase().includes(busquedaCorreo.toLowerCase()) ); - const handleDownload = async () => { - try { - const res = await axiosInstance.get( - `/cuestionario-respondido/reporte-respuestas/${idEventoSeleccionado}`, - { - responseType: 'blob', - } - ); - - downloadFile(res.data, 'lista_participantes', 'xlsx'); - } catch (error) { - toast.error('Error al descargar la lista de participantes'); - console.error('Error al descargar la lista de participantes:', error); - } - }; - return (
-
+
-- 2.43.0