From c8237c68cb1007d30417b8d7130e03eb20bf2e3f Mon Sep 17 00:00:00 2001 From: Vincent BRIDIER Date: Wed, 23 Oct 2024 11:28:23 +0200 Subject: [PATCH] fix: Fix onChange civility value on club shop form --- .../components/club/shop/RecapComponent.vue | 22 ++++++++++++------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/resources/ts/club/components/club/shop/RecapComponent.vue b/resources/ts/club/components/club/shop/RecapComponent.vue index 3fdf4189..f291facf 100644 --- a/resources/ts/club/components/club/shop/RecapComponent.vue +++ b/resources/ts/club/components/club/shop/RecapComponent.vue @@ -25,6 +25,7 @@ id="userCivility" class="form-select" :aria-label="trans.methods.__('Choisir la civilité dans la liste déroulante')" + @change="setCivility($event)" > @@ -109,6 +109,7 @@ id="userCivility" class="form-select" :aria-label="trans.methods.__('Choisir la civilité dans la liste déroulante')" + @change="setShippingCivility($event)" > @@ -494,20 +494,26 @@ function selectPayement(payment: number): void { /** * Add specific item to the customer cart. - * @param civility "{label: string, value: number}" + * e.target.value = "{label: string, value: number}" + * + * @param e Event * @return void */ -function setCivility(civility: number): void { - form.value.coords.civility = civility; +function setCivility(e: Event): void { + const input = e.target as HTMLOptionElement; + form.value.coords.civility = parseInt(input.value); } /** * Add specific item to the customer cart. - * @param civility "{label: string, value: number}" + * e.target.value = "{label: string, value: number}" + * + * @param e Event * @return void */ -function setShippingCivility(civility: number): void { - form.value.shipping!.civility = civility; +function setShippingCivility(e: Event): void { + const input = e.target as HTMLOptionElement; + form.value.shipping!.civility = parseInt(input.value); } /**