Skip to content

Commit

Permalink
fix: 🐛 fix value not found on contact expert form
Browse files Browse the repository at this point in the history
  • Loading branch information
thomashbrnrd committed Sep 20, 2024
1 parent b1bf1db commit 66627f9
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 115 deletions.
30 changes: 13 additions & 17 deletions frontend/src/views/GuideAskingExpertise/ExpertiseForm.vue
Original file line number Diff line number Diff line change
Expand Up @@ -63,28 +63,25 @@

<div class="justify-center fr-pb-15w">
<DsfrInput
v-model="lastname"
v-model.trim="lastname"
class="mb-5"
label="Nom"
label-visible
required="true"
disabled="true"
/>
<DsfrInput
v-model="firstname"
v-model.trim="firstname"
class="mb-5"
label="Prénom"
label-visible
required="true"
disabled="true"
/>
<DsfrInput
v-model="nigend"
class="mb-5"
label="NIGEND"
label-visible
required="true"
disabled="true"
/>
<DsfrInput
v-model="service"
Expand All @@ -102,7 +99,7 @@
/>
<DsfrInput
id="adresse"
v-model="email"
v-model.trim="email"
class="mb-5"
label="Adresse électronique"
type="email"
Expand All @@ -116,15 +113,15 @@
<div v-if="currentStep === 2">
<div class="justify-center fr-pb-15w">
<DsfrInput
v-model="seizure"
v-model.trim="seizure"
class="mb-5"
label="Date de la saisie"
type="date"
label-visible
required="true"
/>
<DsfrInput
v-model="una_or_procedure_number"
v-model.trim="una_or_procedure_number"
class="mb-5"
label="UNA / Numéro de procédure"
label-visible
Expand Down Expand Up @@ -422,10 +419,10 @@ const getUserData = async () => {
try {
const user = await mgr.getUser();
email.value = user.profile.email;
service.value = user.profile.service;
nigend.value = user.profile.nigend;
firstname.value = user.profile.given_name;
lastname.value = user.profile.family_name;
service.value = user.profile?.service;
nigend.value = user.profile?.police_matricule;
firstname.value = user.profile?.first_name;
lastname.value = user.profile?.last_name;
phone.value = user.profile.phone_number;
seizure.value = todayDate;
access_token = user?.access_token;
Expand Down Expand Up @@ -466,13 +463,12 @@ var access_token = "";
// Validation des champs
const stepValidations = {
1: () =>
lastname.value.trim() !== "" &&
firstname.value.trim() !== "" &&
lastname.value !== "" &&
firstname.value !== "" &&
nigend.value !== "" &&
phone.value !== "" &&
email.value.trim() !== "",
2: () =>
seizure.value.trim() !== "" && una_or_procedure_number.value.trim() !== "",
email.value !== "",
2: () => seizure.value !== "" && una_or_procedure_number.value !== "",
3: () => {
const baseValidation =
left_picture.value && right_picture.value && markings_pictures.value;
Expand Down
Loading

0 comments on commit 66627f9

Please sign in to comment.