-
Notifications
You must be signed in to change notification settings - Fork 0
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
Feature/s06 fullcalendar back #66
base: develop
Are you sure you want to change the base?
Conversation
@@ -11,6 +11,6 @@ export const dataSource = new DataSource({ | |||
|
|||
// TypeORM configuration | |||
entities: ["src/entities/*.ts"], | |||
synchronize: true, | |||
synchronize: false, |
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.
Doit rester à true, on ne le passe à false que lorsqu'on a des problèmes de synchro.
where: { | ||
id: eventId, | ||
trainer: { id: trainerId }, | ||
service: { id: serviceId }, |
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.
Pourquoi on a besoin de l'id de l'event, du trainer ET du service ? Normalement l'id de l'event est unique donc pas besoin du reste, non ?
Si c'est pour vérifier que c'est bien le bon trainer qui a le droit d'éditer cet event alors ok pour cette vérification mais le service reste inutile à mon sens.
async updateEvent( | ||
@Arg("eventId") eventId: number, | ||
@Arg("trainerId") trainerId: number, | ||
@Arg("serviceId") serviceId: number, |
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.
Tu demandes ces trois arguments dans l'update mais on ne les a pas dans le retour du getEventById du coup le front n'y a pas accès lors d'une update pour le moment.
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.
Question : est-ce qu'un utilisateur doit pouvoir changer le service de son event lors d'une update ? Si oui, le cas n'est pas géré.
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.
En effet, je pensais inclure le serviceId pour ça, afin de pouvoir modifier la nature de l'événement. Je vais faire en sorte de gérer le cas !
price: number; | ||
|
||
// Ajouter une @Column duration pour la durée, voir si on l'ajoute en minutes, en heure... | ||
// L'ajouter ici |
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.
Euh bah, vas-y ? 🤣
Mets la déjà en minutes, ça me semble le plus précis, on verra si on fait évoluer ça.
service { | ||
id | ||
name | ||
} |
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.
Ces jonctions ne sont pas gérées dans le resolver.
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.
Il manque le price et peut-être le service id et le user id ?
|
||
interface GetAllEventsData { | ||
getAllEvents: Event[]; | ||
} |
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.
ça vaut le coup de les mettre dans un dossier de types et de les exporter, je pense qu'on les réutilisera. Et si possible d'ajouter Type dans le nom pour qu'on sache de quoi on parle.
} else if (userRole === "owner") { | ||
navigate(`/owner/planning/${eventId}`); | ||
} else { | ||
// If unauthorized user try to force the URL |
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.
if an* et tries*
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.
Je te laisse voir les commentaires, le problème principal je pense tiens surtout dans l'utilisation du service.id pour récupérer/updater un event.
🗓️ FullCalendar Back - Événements :
⌛ Il va falloir que je fasse le lien avec les mutations pour le détail des événements, ainsi qu'ajouter le front qui va avec. Je le ferais à mon retour de congés la semaine du 24/02/2025