fix : erreur customer adress et bouton valider oublie

This commit is contained in:
2026-02-26 14:32:06 +01:00
parent 4b93c100b0
commit 09db30af72
3 changed files with 11 additions and 6 deletions

View File

@@ -12,7 +12,7 @@
type="submit"
:disabled="isLoading"
>
<Icon :name="props.address ? 'mdi:check' : 'mdi:plus'" size="28" />
<Icon :name="props.address ? '' : 'mdi:plus'" size="28" />
{{ props.address? "Valider" : "Ajouter" }}
</button>
</div>

View File

@@ -190,7 +190,6 @@
type="submit"
class="inline-flex mb-16 items-center justify-center text-xl text-white uppercase bg-primary-500 h-[50px] px-8 rounded hover:opacity-80 gap-2 justify-self-end"
>
<Icon name="mdi:check" size="28" />
Valider
</UiButton>
</div>

View File

@@ -256,13 +256,19 @@ const selectedCarrier = computed(() =>
carriers.value.find((carrier) => String(carrier.id) === form.carrierId) ?? null
)
const isLiotCarrier = computed(() => selectedCarrier.value?.code === SUPPLIER_CODE.LIOT)
const isAddressData = (value: unknown): value is AddressData =>
typeof value === 'object' &&
value !== null &&
'id' in value &&
'fullAddress' in value
const customerAddresses = computed<AddressData[]>(() => {
if (!form.customerId) return []
const customerId = Number(form.customerId)
if (!Number.isFinite(customerId)) {
return []
}
return customers.value.find((customer) => customer.id === customerId)?.addresses ?? []
if (!Number.isFinite(customerId) || customerId <= 0) return []
const addresses = customers.value.find((c) => c.id === customerId)?.addresses ?? []
return addresses.filter(isAddressData)
})
const customerAddressOptions = computed(() =>