fix(champ): save departement name without code prefix

This commit is contained in:
Paul Chavard 2021-11-30 19:38:21 +01:00
parent 0a61056ea8
commit ed2cbdc966

View file

@ -93,10 +93,10 @@ function ComboCommunesSearch(params) {
placeholder={placeholderDepartement} placeholder={placeholderDepartement}
addForeignDepartement={false} addForeignDepartement={false}
required={params.mandatory} required={params.mandatory}
onChange={(value, result) => { onChange={(_, result) => {
setDepartementCode(result?.code); setDepartementCode(result?.code);
if (hiddenDepartementField && hiddenCodeDepartementField) { if (hiddenDepartementField && hiddenCodeDepartementField) {
hiddenDepartementField.setAttribute('value', value); hiddenDepartementField.setAttribute('value', result?.nom);
hiddenCodeDepartementField.setAttribute('value', result?.code); hiddenCodeDepartementField.setAttribute('value', result?.code);
} }
}} }}