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

Fix le bug sur les plantes dans le CompositionStep et les preparations viennent du backend #897

Merged
merged 8 commits into from
Aug 27, 2024

Conversation

pletelli
Copy link
Collaborator

@pletelli pletelli commented Aug 26, 2024

Fix #895 et #584

@pletelli pletelli marked this pull request as ready for review August 26, 2024 15:25

const model = defineModel()
const props = defineProps({ objectType: { type: String } })

const plantPartName = computed(() => plantParts.value?.find((x) => x.id === model.value.usedPart)?.name || "Aucune")
const unitName = computed(() => units.value?.find((x) => x.id === model.value.unit)?.name || "")
const preparationName = computed(
() => preparations.value?.find((x) => x.id === parseInt(model.value.preparation))?.name || ""
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Ici, je n'ai pas compris pourquoi l'id (IntegerField) est sérialisé en tant que string.
C'est le cas aussi pour le modèle GalenicFormulation.

Copy link
Collaborator

Choose a reason for hiding this comment

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

La sérialisation backend est bien un integer, mais le input select du html renvoi toujours un string. Sur cette question SO ça parle du pourquoi on ne peut pas retourner un int d'un select.

@pletelli pletelli requested a review from alemangui August 26, 2024 15:26
@pletelli pletelli merged commit 797d2f0 into staging Aug 27, 2024
5 checks passed
@pletelli pletelli deleted the 895 branch August 27, 2024 09:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants