From 63be3a1efca038b5940e05f0324878dbf9ec4a30 Mon Sep 17 00:00:00 2001 From: Juan Carlos Sigler Priego Date: Sat, 19 Oct 2024 20:39:39 -0400 Subject: [PATCH] Revertir el Martes: Abrir registro para las que tienen cuenta (#95) * Revertir el Martes: Abrir registro para las que tienen cuenta * Para cuentas creadas antes de convocatoria --- src/lib/validators/ofmi.ts | 6 ------ src/pages/api/ofmi/upsertParticipation.ts | 2 +- src/pages/registro.tsx | 6 +----- src/pages/signup.mdx | 3 +++ src/pages/signup.tsx | 5 ----- 5 files changed, 5 insertions(+), 17 deletions(-) create mode 100644 src/pages/signup.mdx delete mode 100644 src/pages/signup.tsx diff --git a/src/lib/validators/ofmi.ts b/src/lib/validators/ofmi.ts index 3c7630a..c600d4d 100644 --- a/src/lib/validators/ofmi.ts +++ b/src/lib/validators/ofmi.ts @@ -9,12 +9,6 @@ export function validateOFMIOpenAndCloseTime( role, }: { registrationTime: Date; role: ParticipationRole }, ): ValidationResult { - if (ofmi.registrationOpenTime.getTime() > registrationTime.getTime()) { - return { - ok: false, - message: `Las inscripciones para esta OFMI aun no han abierto.`, - }; - } if (role === "VOLUNTEER") { // Vamos a darles todo el año para registrarse if ( diff --git a/src/pages/api/ofmi/upsertParticipation.ts b/src/pages/api/ofmi/upsertParticipation.ts index 4a18da9..1e7a99e 100644 --- a/src/pages/api/ofmi/upsertParticipation.ts +++ b/src/pages/api/ofmi/upsertParticipation.ts @@ -87,7 +87,7 @@ async function upsertParticipationHandler( field: "Fechas de registro OFMI", result: validateOFMIOpenAndCloseTime(ofmi, { role, - registrationTime: requestStartTime, + registrationTime: authUser.createdAt, }), }, ]; diff --git a/src/pages/registro.tsx b/src/pages/registro.tsx index 6e770bd..de4175d 100644 --- a/src/pages/registro.tsx +++ b/src/pages/registro.tsx @@ -17,13 +17,9 @@ import { X_USER_AUTH_EMAIL_HEADER } from "@/lib/auth"; export default function RegistroPage({ ofmiEdition, participationJSON, - registrationClosingTime, role, }: InferGetServerSidePropsType): JSX.Element { - if ( - ofmiEdition == null || - (registrationClosingTime && registrationClosingTime < Date.now()) - ) { + if (ofmiEdition == null) { const errorMsg = ofmiEdition ? "El registro de la OFMI ha finalizado." : ""; return (
diff --git a/src/pages/signup.mdx b/src/pages/signup.mdx new file mode 100644 index 0000000..f8c5bd8 --- /dev/null +++ b/src/pages/signup.mdx @@ -0,0 +1,3 @@ +# La creación de cuentas estará fuera de servicio unos días + +
Vuelva pronto
diff --git a/src/pages/signup.tsx b/src/pages/signup.tsx deleted file mode 100644 index f39e11b..0000000 --- a/src/pages/signup.tsx +++ /dev/null @@ -1,5 +0,0 @@ -import SignUp from "@/components/signup"; - -export default function LoginPage(): JSX.Element { - return ; -}