-
Notifications
You must be signed in to change notification settings - Fork 5
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
Conversation
Current dependencies on/for this PR: This comment was autogenerated by Freephite. |
src/pages/api/mentoria/schedule.ts
Outdated
await prisma.mentoria.upsert({ | ||
where: { | ||
volunteerParticipationId_contestantParticipantId_meetingTime: { | ||
volunteerParticipationId, | ||
contestantParticipantId, | ||
meetingTime, | ||
}, | ||
}, | ||
update: {}, | ||
create: { | ||
volunteerParticipationId, | ||
contestantParticipantId, | ||
status: "SCHEDULED", | ||
meetingTime, | ||
metadata: { | ||
calendly: calendlyPayload, | ||
}, | ||
}, | ||
}); |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fair
src/lib/calendly.ts
Outdated
token: string; | ||
url: string; | ||
// eslint-disable-next-line @typescript-eslint/no-explicit-any | ||
}): Promise<any> { |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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); |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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
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 |
Ahora cada que una mentoria se agenda, registrémoslo en nuestra BD