-
Notifications
You must be signed in to change notification settings - Fork 3
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
migration: postgres mes-adresses-api #945
Conversation
BUG BUILD GITHUB: vercel/next.js#69263 |
contexts/markers.tsx
Outdated
return [...prevMarkers, { _id: uniqueId(), ...marker }]; | ||
return [ | ||
...prevMarkers, | ||
{ id: new Types.ObjectId().toHexString(), ...marker }, |
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.
Pour les positions je trouve que ça serait plus élégant d'utiliser des UUIDs, là côté front ça nous fait importer mongoose juste pour générer les objectIds et côté back on utilise la fonction custom pour la primary key alors qu'un petit @PrimaryGeneratedColumn("uuid") ferait le taff
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.
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.
J'ai opté pour la deuxième solution, comme il y a this.id = new ObjectId().toHexString();
, si l'on remet la ligne return [...prevMarkers, { _id: uniqueId(), ...marker }];
cela marche quand même (l'id est écrasé par le BeforeInsert de l'entity position) donc pas de soucis ;)
PR