-
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
✨🏢 Improve I-CAD storage and search #599
base: dev
Are you sure you want to change the base?
Conversation
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.
@@ -119,7 +119,7 @@ export async function action({ request, params }: ActionFunctionArgs) { | |||
colorId: formData.data.colorId || null, | |||
description: formData.data.description || null, | |||
gender: formData.data.gender, | |||
iCadNumber: formData.data.iCadNumber || null, | |||
iCadNumber: formData.data.iCadNumber.replace(/\s+/g, "") || null, |
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.
C'est la bonne manière de retirer les espaces 👌.
Comme tu peux voir, tu as dû faire le changement dans les deux fichiers (edit et new). Cette transformation peut être écrite une seule fois si elle est déplacée dans l'objet ActionFormData
du fichier apps/admin/src/animals/profile/form.tsx.
ActionFormData
est utilisé pour valider et transformer les données issues du formulaire de profil d'un animal (AnimalProfileForm
, dans le même fichier, utilisé pour la création et édition).
En t'inspirant des transformations déjà présentes (isOkCats
et isOkChildren
), ta mission si tu l’acceptes (🤣), est de déplacer les .replace()
dans une transformation sur iCadNumber
.
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 description provided.