Skip to content

Commit

Permalink
Revert "Revertir el Martes: Abrir registro para las que tienen cuenta (
Browse files Browse the repository at this point in the history
…#95)" (#96)

This reverts commit 63be3a1.
  • Loading branch information
Juanito98 authored Oct 23, 2024
1 parent 685286d commit c7bbefc
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 5 deletions.
6 changes: 6 additions & 0 deletions src/lib/validators/ofmi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,12 @@ 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 (
Expand Down
2 changes: 1 addition & 1 deletion src/pages/api/ofmi/upsertParticipation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ async function upsertParticipationHandler(
field: "Fechas de registro OFMI",
result: validateOFMIOpenAndCloseTime(ofmi, {
role,
registrationTime: authUser.createdAt,
registrationTime: requestStartTime,
}),
},
];
Expand Down
6 changes: 5 additions & 1 deletion src/pages/registro.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,13 @@ import { X_USER_AUTH_EMAIL_HEADER } from "@/lib/auth";
export default function RegistroPage({
ofmiEdition,
participationJSON,
registrationClosingTime,
role,
}: InferGetServerSidePropsType<typeof getServerSideProps>): JSX.Element {
if (ofmiEdition == null) {
if (
ofmiEdition == null ||
(registrationClosingTime && registrationClosingTime < Date.now())
) {
const errorMsg = ofmiEdition ? "El registro de la OFMI ha finalizado." : "";
return (
<div className="flex w-full items-center justify-center">
Expand Down
3 changes: 0 additions & 3 deletions src/pages/signup.mdx

This file was deleted.

5 changes: 5 additions & 0 deletions src/pages/signup.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import SignUp from "@/components/signup";

export default function LoginPage(): JSX.Element {
return <SignUp />;
}

0 comments on commit c7bbefc

Please sign in to comment.