Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Registrar historial mentorias #102

Merged
merged 3 commits into from
Nov 5, 2024
Merged

Conversation

Juanito98
Copy link
Contributor

@Juanito98 Juanito98 commented Nov 4, 2024

Ahora cada que una mentoria se agenda, registrémoslo en nuestra BD

image

@Juanito98
Copy link
Contributor Author

Juanito98 commented Nov 4, 2024

Current dependencies on/for this PR:

This comment was autogenerated by Freephite.

@Juanito98 Juanito98 enabled auto-merge (squash) November 4, 2024 04:09
@Juanito98 Juanito98 requested a review from aaron-diaz November 4, 2024 06:42
src/lib/calendly.ts Outdated Show resolved Hide resolved
Comment on lines 51 to 69
await prisma.mentoria.upsert({
where: {
volunteerParticipationId_contestantParticipantId_meetingTime: {
volunteerParticipationId,
contestantParticipantId,
meetingTime,
},
},
update: {},
create: {
volunteerParticipationId,
contestantParticipantId,
status: "SCHEDULED",
meetingTime,
metadata: {
calendly: calendlyPayload,
},
},
});
Copy link
Contributor

@aaron-diaz aaron-diaz Nov 4, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Debido a que no tenemos un global error handler, creo que esto debe de ir dentro de un bloque de try catch. Tambien, si el endpoint solo permite la creacion de eventos pero no la edicion de los mismos (para reagendar o cambiar la razon del evento), creo que debemos usar create en vez de upsert. Siento que estas ocupando upsert para evitar cachar un error.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fair

token: string;
url: string;
// eslint-disable-next-line @typescript-eslint/no-explicit-any
}): Promise<any> {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Debido a que es posible que esta funcion sea usada en un futuro por alguien mas, definamos el tipo de la respuesta. Me preocupa ver el disable no-explicit-any en varias partes del repo.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hecho

const ofmi = await findMostRecentOfmi();
const participation = await findParticipation(ofmi, email);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Si la participacion es nula (porque no se encuentre registrada a la ultima OFMI), queremos permitir que agende mentorias?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, no queremos.
A largo plazo abrí este issue para lidiar con rutas que queremos solo sean si te registraste
#103

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Redirigí a home de mientras

@aaron-diaz
Copy link
Contributor

Y los tests Juanito?

@Juanito98
Copy link
Contributor Author

Juanito98 commented Nov 5, 2024

Y los tests Juanito?

Abrí un pull request aparte para los tests. Va a ser un cambio mediano y no quisiera bloquear empezar a trackear mentorías

@Juanito98 Juanito98 requested a review from aaron-diaz November 5, 2024 01:11
@Juanito98 Juanito98 merged commit 72487bd into main Nov 5, 2024
1 check passed
@Juanito98 Juanito98 deleted the 11-03-Registrar_historial_mentorias branch November 5, 2024 03:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants